Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




#ERROR In DataGrid Cell


I have a DataGrid bound to an Oracle Database. I have just inserted a row from VB and one of the columns in the table had a DATE Data Type. When I go into Oracle's DBA Studio to see the date value in the database, all looks well, but when I bind the DataGrid to the Table, I get "#ERROR" in the cells where there should be a date. Any ideas? Thanks, Jeremy

Knowledge is the most powerful tool a person can obtain.

DeveloperKB




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
How TAB Key Used In The DataGrid Control For Shifting Cell By Cell
Hello Friends,
       I am using DataGrid Contol in my Application to Enter the data and the DataGrid is associated with the RecordSet of the Adodb and it is directly add and update the data.
    Now my Problem is how can i go from on cell to another by pressing TAB key.


-Waiting For your Suggetions.

Datagrid Showing "#ERROR" In Every Cell
Hi, when I do a transaction all of the cells of a datagrid automatically say "#ERROR", I think is after the commit. It happens in 2 datagrids I have in different forms and that are populated with data from different recordsets. Any ideas or suggestions will be appreciated. Thanks

How Can I Drag A Cell From One Datagrid And Drop In Antoher Datagrid?
Hi,

I am beginner of VB. I wanna drag a cell from one DataGrid and drop in another one. How could I do that? Anybody knows, plesae give me a help. Thanks in advance!

Copying A Cell From A Datagrid To Another Datagrid
My question is how to copy a datagrid cell to another datagrid cell?

for example; datagrid1 column 1, row 1 to datagrid2 column 2, row 3

I use

DataGrid1.Columns(1).CellValue(DataGrid1.RowBookmark(1)) to capture the value, but I don't know the expression how to copy to datagrid2

Thanks

How To Next Cell On Datagrid
next record.JPG
On every cell if I press ENTER then the cursor go to the next cell,
and if cell is the last cell then the cursor go to the next record

how to do that on VB 6

Getting The Sum In Datagrid Cell
hello there!
how do i get the sum in datagrid e.g in cell(2) values are:
600
700
200
total=1500

adodc1.recordsource ="select * from mytable where id_no=2"

then i will pass sum in the label1.caption = total in datagrid.cell(8)

tnx a lot

How To Get The Value Of A Particular Cell In Datagrid
Hi,
I have a data grid which populates values from a table. I need the cell value of the datagrid to use it for some other purpose.

I did this, but it seems to only give the cell number and not the value


VB Code:
MsgBox "Cell(" & pricing.Row & ", " & pricing.Col & _        ") "        pricing.SetFocus


I tried this, but looks like it is for the datagrid web control


VB Code:
s = pricing.Items(0).Cells(1).TextMsgBox s



Please help

Set A Value In A DataGrid Cell
I work in VB6 with a DataGrid control. I try to validate data in a BeforeColUpdate event of DataGrid. When the value is wrong I want to correct the value. I use the folowing statement, like in VB Help documentation:
DataGrid1.Columns(ColIndex).Value=correct_value
but this statement doesn't work - it does nothing, the old value remains.
How can I set a value in a DataGrid column ?

Cell Datagrid
how can i change just a cell background in datagrid?

Datagrid Cell
I have a dataGrid.
what i'm trying to do is when i use my down arrow, the row in dataGrid will be selected
from column 1 to the last column.

what i have done is to use dataGrid1.selStartCol and dataGrid1.selEndCol but this is fr the column.

how to make for just one row at a time ?

Thanks

Right Justify A Cell In A Datagrid
i have several cells that i'd like to right justify within a datagrid (not an entire column or row). can this be done?

DataGrid Cell Edit
Hi,

I need help using a datagrid. I'm trying to edit a cell's value during runtime. I have the following code in my datagrid's double click event:

With DataGrid1
.Columns(.Col).Value = "Value1"
End With

But the datagrid does not work. I think it's probably locked or something.

Any help would be appreciated. Thanks.

Datagrid Cell Exclution
Hi,
I have tried different ways of stopping a user from entering a particular Cell in a datagrid, I can get it so the user clicks the cell and can not alter the data but can not stop the cell from highlighting, is this possible.

Searching To Datagrid Cell
Hi, all
I'm new to vb 6 database programming.
I have a problem finding a selected record in my datagrid

the datagrid works fine and it display all of my database contain

this is my case :
i have a textbox and everytime i type a word (for example "John") i want the datagrid recordset move to the row where the word "John" exist . I don't know how to make it work. Please help me.

Best Regards,

Robert

How To Edit Only One Cell In Datagrid
I want edit only one cell in a datagrid

i am using this code

on key press

Private Sub FgCalc1_Click()

Select Case FgCalc1.Row

Case 6
If FgCalc1.TextMatrix(6, 4) <> "" And FgCalc1.TextMatrix(6, 12) <> "" Then
FgCalc1.EditCell
End If
End Select
End Sub


Private Sub FgCalc1_AfterEdit(ByVal Row As Long, ByVal Col As Long)

If Asc(FgCalc1.TextMatrix(6, 4)) < 48 Or Asc(FgCalc1.TextMatrix(6, 4)) > 57 Then
MsgBox ("Please Enter correct value")
FgCalc1.TextMatrix(6, 4) = "4"
End If
If Asc(FgCalc1.TextMatrix(6, 12)) < 48 Or Asc(FgCalc1.TextMatrix(6, 12)) > 57 Then
MsgBox ("Please Enter correct value")
FgCalc1.TextMatrix(6, 12) = "0"

End If

End Sub

but it will allow whole row to be edit so i dont want to allow user to edit any other cell in this row

please help me....

Changing A Datagrid Cell Value...
is it possible to change a datagrid value? for example,

password

••••••••

does anyone knows how?

Getting Text From A Cell In A Datagrid?
I would like to get the text in a specific cell in a datagrid. I know with VB.NET, you can use grid.Item() and it can also be done using a flexgrid in VB6 with no problem. But for speed reasons (a datagrid + ado loads records faster than ado + flexgrid because of the need to populate the grid programmatically), I would like to stick with a datagrid. I'd rather use a flexgrid because I prefer its fuctionality, but when loading 30 columns of data with 10,000+ entries, it bogs the application down a bit. The datagrid populates pretty much instantaneously.

So I have the datagrid and ado recordsource set to "select * from results" And I want to get the text in the grid from column x, curent row (grid.Row)

Sounds easy enough, but I can't find anything about it for VB6.



Thanks for the help.

DataGrid Cell Identify
I have not had success with the identifying on the Value of the cell on dblclick in the database. I am trying to identify any one cell and open a form window to display multiple records from the database in text boxes. The code I have attempted is returning an error of "no value given for one or more required parameters"
Code Used:
Private Sub grdInventoryScroll_DblClick()
'advance to the InventoryEdit form
Dim nCarno As String

nCarno = grdInventoryScroll.Columns(1).Value
LoadNameFields

frmInventoryEdit.Show
frmInventoryEdit.Refresh

End Sub

Thanks for any advice.

DataGrid Cell Contents
I am using this sub to let me click on and highlight a row:


Code:
Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
If (DataGrid1.SelBookmarks.Count <> 0) Then
DataGrid1.SelBookmarks.Remove 0
End If
DataGrid1.SelBookmarks.Add DataGrid1.Bookmark 'This makes it where you can click a row and highlight it
'txtVal = DataGrid1.Text
'MsgBox (txtVal)
End Sub


Can someone tell me how to get the contents of each cell in the highlighted row? Thanks, Jeremy

DataGrid Cell Formatting
I have a DataGrid that is bound to an Oracle Database. Well, Oracle cuts off zeros before and after a number and when I bind my DataGrid to the database, it pulls out:

QUOTE_NUM
1
5
7
14

And I want it to look like:

QUOTE_NUM
000000001
000000005
000000007
000000014

in the DataGrid. Can someone help? Thanks, Jeremy

Set Color In DataGrid Cell
Do anyone know if I can change the ForeColor of a particular cell in datagrid?

I have tried listview in report mode, I can change the color, but I cannot let the user to edit the subitem in the listview except the first column.

Do anyone have any idea that can
1. change color, and
2. edit data in any cell in the grid?

Thank you very much!

Ama

How To Know Current Cell Of A Datagrid ???
hi,

how can i know which cell the user is in or is currently editing in the datagrid, how can i add a combo box or a datagrid in the current cell of a datagrid

please help

thanks

bye

pratik

Clearing Datagrid Cell
Hi Folks

Anyine know how to clear a datagrid cell of its current entry, or return it to its former state i.e. blank.
Im trapping for duplicates using beforeupdate() but I need to clear the offending datagrid entry so that the user wont leave it there and use another control, thus implicitly crashing the app.

Thanks in advance

Datagrid Cell Validation
Hi Folks
Does anyone know how I can do validation on individual cells in a datagrid?.

Thanks in advance

Locking A Cell In Datagrid
Hi;
How can i lock or unlock a cell in datagrid?for example; i want tounlock (row 3 column4).

Datagrid Cell Query
Is there a way to examine a datagrid cell upon Change for specific text?

In other words, the user modifies the data in a Datagrid cell, and the code examines the cell to see if the new text is a specific string.

How To Read Value From A Certain Cell In Datagrid
Hi, I have some questions on datagrid.
Q1) In datagrid they have .columns(n) for you to refer to a certain column. For example, [some grid].columns(0) let's you refer to the 1st column. But I don't know how to get values from a certain cell. I have tried this:

Dim CellThings as string
CellThings = DGrid.Columns.Item([some number]).Value
But it is not working correctly.

I also tried
CellThings = DGrid.Columns.Item([some number]).CellText
And results in error.

Q2) How do you refer to a row in datagrid?
DGrid.Rows(0) doesn't seem right.

Datagrid Cell Maximum
hello,

i am working on a windows form in vb.net with a datagrid. i want a datagridtextboxcolumn that contains numerics to allow the user to ONLY be able to type in a value of 6 numbers and no more. how do i go about programming for this? if i set the column SIZE to six it STILL allows the user to keep on typing in as many values as they wish due to the word wrap feature.

any direction would be appreciated!

Value Of Specific Cell In DataGrid
Hi!
i am displaying data in a DataGrid. In Click()event i want to get the column(0).value, column(1).value and column(3).value in to variables , of that row. Then i have to open a recordset, these 3 variables as parameters.

Code:Private Sub grdDataGrid_Click()
Dim sCurAccType$, sCurTaxType$, sStatus$
Set rsShowDetails = New ADODB.Recordset
sCurAccType = grdDataGrid.Columns(0).Text 'Account_Type
sCurTaxType = grdDataGrid.Columns(1).Text 'Tax_Type
sStatus = grdDataGrid.Columns(3).Text 'Status
rsShowDetails.Open ("SELECT * FROM tbl_TransDetails WHERE Account_Type = '" & sCurAccType & "'" _
                    & " AND Tax_Type= '" & sCurTaxType & "'" _
                    & " AND Status = '" & sStatus & "'" _
     & " AND Entry_Date = #" & cmbEntryDate.text & " # " )
Me.Hide
Show frmShowDetails
End Sub
I tried with the above code. It is getting values, but with the first row of data. but i want to get values of the row i clicked. Please help me.
Thanks!
>>>>>>>>>>>>>>



Edited by - sreddy on 3/22/2005 8:04:45 AM

Put The Cursor Into A Specified Cell In Datagrid
Hi,
I want to put the cursor into a specified cell in a datagrid so the user can edit that cell without clicking it.

can you help me plz ?!

How Do I Setfocus To A Cell In A Datagrid
hi all.
how can i setfocus to a cell in a datagrid?
i want to set focus to a cell and then change his background.

Backcolor Of A Cell In Datagrid
hi all.
1) can i change the backcolor of a cell in a datagrid?
2) can i edit data in a mshflexgrid?

How Do You Highlight A Cell In The Datagrid?
I've been desperately trying to figure out how to highlight a cell in the Datagrid control. All the solutions I could find in the forums and at the MS website involve using .SelStartRow & .SelEndRow, neither of which seem to be supported by VB6 (service pack 5.0) any longer (I get errors that I'm trying to use an "Unknown Property or Method" when I include them). Is there a way around this or a way to enable the .SelStartRow & .SelEndRow properties?

Help Me To Clear DataGrid Cell
Hi All,
Im working on master detailed using datagrids on a windows form. When i try to insert new row in a child table datagrid, all the columns appear (NULL) , ( NULL) like this. But I would like to shoe blank space in taht cell and aloow to enter some thing. Pl help me how can i cheive this
I appreciate any kind of suggestions.
Thanks
Bye

Datagrid Cell Contents
Hi.

I have written a procedure which (as you might imagine) populates a datagid with a variety of data.

I need to examine the contents of any particular cell, but am not sure how to assign the cell contents to a variable without clicking on it.

This code:

DataGrid1.Columns("ProductID").CellText(DataGrid1.Bookmark)

allows me to retrieve the contents of the 'ProductID' field, but I am unsure about how to negotiate around other records so that I can examine their 'ProductID'.

How can I do it?

MaxLength Of Cell - DataGrid ? Pls Help
How can i set the MaxLength of each Column of a DataGrid ?
Pls help. It's urgent.

Edit A Cell In A Datagrid
Hello, I have a problem that is driving me crazy because I have it working on other forms. I've got a data grid and I want to be able to double click in a specific cell in order to edit the cell. In my other forms, I can double click in the cell and it brings up my cursor so I can start typing. With this new form, when I double click, it highlights the whole cell but never gives me a cursor.

Does someone know (at one point in time I did!) what property I need to adjust so that I can double click in a specific spot within a cell and get a cursor? Thanks very much.

Bob

ADO/Datagrid Cell Value After Edit
I am using a datagrid which is populated with the results of an ADO generated recordset, that allows the user to edit some fields.

What I want to do, is after the user has edited the contents of a cell and moves off this cell, check to see what the cell contents are to remove any trailing blanks. I've tried looking at the AfterColEdit event and BeforeColEdit/Upate events, but they only seem to show the old value, and not the new.

I haven't loaded any of the VB service packs, so could this affect things? I've got SP3 ready to load, been told to avoid SP4 because of possible knock on problems with SQL server 7 (upates MDAC to 2.5?) so steered clear of this so far.

I tried trimming the data in the select part of the recordset but this stops changes to the data being sent back to the database.

Thanks for any ideas.

Wrap Cell In Datagrid All The Time?!
When you set the wrap text in properties you can only wrap the text when the cell has focus. Is there a way to make it wrap all the time?

How To Pick Value From A Specific Cell In DataGrid
hi dears

how can i pick value of a specific cell from a datagrid.

thanx in adavance

tariq

Datagrid - Accessing Content Of A Cell
I have a datagrid that has a datasource of an ado data control. The data control accesses a table in an Access database that is a list of names (REQUESTORNAMES).

On my form the datagrid is visible to the user, who can change one of the names if needed (i.e. if a name is spelled wrong). Once this change is made, I need to grab that new name and search another table (Workorders table) for every instance of that name and change it to the corrected name.

How do I go about getting access to that cell's contents? I have been playing with bookmark, but I am not making much headway. Does anyone have a suggestion?

Thanks much

Keeping Focus In Datagrid Cell
how does one keep focus in a datagrid cell if the user types in invalid data?

Datagrid - How To Disable Clicking On One Cell?
I have a datagrid that is populated from a database table. The table gets it's information from a string that is collected and parsed. When the user selects (clicking on the gray box next to the row they want) in the datagrid, I have a command button that then takes all of the information from that datagrid row and performs some queries on it.

Here's the problem. If the user clicks on a specific cell in the row (instead of the gray box next to the row), and hits the command button I get an "out of range" error from the command button.

The only thing I can think is that when the user clicks a cell instead of the row indicator, the all of the informatin isn't being sent to the command button code area. If they click the left, there are no errors. But regardless of the row they choose, if they click a cell, "Out of range" error.

Is there any way to make it so the user has to click the row indicator OR, if then they click a cell, to make sure all information from the datagrid is sent?

Thanks in advance if you can help me out.

DTFan

How To Alter Cell Text In DataGrid
Hi folks,
I'm populating a DG straight from the database as part of a form load. Two of the fields I'm collecting are Boolean, is there anyway in the DG columns I can automatically change the O / -1 s to 'Yes' and 'No' in the same form load?
Cheers,
Nick

SetFocus In Specific DataGrid Cell
How do I specify A datagrid cell
I have the column and row numbers
Just cant figure out correct syntax to place the cursor

How To Set Focus To Specific Cell In A Datagrid?
Hello brainy people,

I love this place because there are so many brainier people than me here. I can usually find answers to my insignificant little problems with a simple search. But this time I need to post.

I have a datagrid (datagrid1) on my form which is linked to an ADO recordset (rsProductCosts). To validate the data entered by the client I use the sub Datagrid1_Validate to loop through the recordset and check that each required column has been completed and it's contents confirm to the required datatype. The point at which I am having a problem is passing focus back to the relevant cell of datagrid1 when the data doesn't pass validation. The validate method automatically returns focus to the datagrid but not to the cell which requires action by the client. I have tried the following;

rsProductCosts.AbsolutePosition = currentrow
DataGrid1.col = currentcol

but I can't seem to get it to work. Is it even possible.

Regards
JohnFromPerth

Selecting Text In A Datagrid Cell
I have a datagrid with (suprise) so data in it. Currently when I single click a cell to begin editing it the entire contents of the cell become highlighted. Is there any way to move the select point to the end of that cell's contents by default when I enter the cell to edit it?

Thanks in advance. =)

Datagrid Cell Access Problem!
How to access the value of each cell of a datagrid using a 'for loop'.

Datagrid, Cell Lost Focus
Hi!
I've a datagrid where I can update, but when i update a cell, I want validate that this cell wasn't null. I do this in the datagrid_AfterColUpdate and for the first time it's ok, i see the error messagge perfectly.
If I click in another cell, this messagge doesn't appear anymore.

How can I do for not loose the focus and for each click in another cell i see the messagge until the error be correct?

Thanks for any help.

The code is:

Private Sub dgMensajes_AfterColUpdate(ByVal ColIndex As Integer)
If dgMensajes.Columns(1).Text = "" Then
dgMensajes.Col = ColIndex
General.manejoError ("ERR-0010")
ElseIf dgMensajes.Columns(2).Text = "" Then
dgMensajes.Col = ColIndex
General.manejoError ("ERR-0013")
Else
rsMensajes.Update
End If
End Sub

Copyright © 2005-08 www.BigResource.com, All rights reserved