Msflexgrid Saving to database problem
I've got a problem with my msflexgrid1 while attempting to save the data
to the database.
:confused:
I get an datatype conversion error...but I can't figure out why. I aslo dont
understand the big numbers that I get while looking at the msflexgrid1.text
value.
:confused:
HElp!!!!!!!!!!!
:confused:
Please offer some thoughts!!
:confused:
If I leave my cursor/mouse on that erorr line I get the value for msflexgrid1.text
which is a hudge number: 11753595471532175421000000000000000000000000000000000000 . . . .
VB Code:
Private Sub Command4_Click()
'save button CODE IS BELOW ?> > >
'declare local variables . .
Dim r As Integer
Dim t As Long
myrs.MoveFirst
For r = 1 To MSFlexGrid1.Rows - 1 ' cycle thru the rows
myrs.Edit ' this opens the recordset record to be opend to be edited
MSFlexGrid1.Row = r
For t = 0 To myrs.Fields.Count 'cycle thru the fields/columns
MSFlexGrid1.Col = t
myrs.Fields(t) = Format$(Val(MSFlexGrid1.Text)) [COLOR=royalblue]Error Here::3421 Data Type Conversion Error[/COLOR]
Next t
myrs.Update
myrs.MoveNext
Next r
end Sub
SAVE PROBLEM TO DATABASE USING FLEXGRID
Ok, still stuck.
I tried removing those val and format, and now I get an error that says
the field is unupdateable.
Field cant be updated. Erorr 3164.
What does that error mean & how can it be fixed >?
Thanks for the help.
VB Code:
visual basic code:
Private Sub Command4_Click()
'save button CODE IS BELOW ?> > >
'declare local variables . .
Dim r As Integer
Dim t As Long
myrs.MoveFirst
For r = 1 To MSFlexGrid1.Rows - 1 ' cycle thru the rows
myrs.Edit ' this opens the recordset record to be opend to be edited
MSFlexGrid1.Row = r
For t = 0 To myrs.Fields.Count 'cycle thru the fields/columns
MSFlexGrid1.Col = t
myrs.Fields(t) = Format$(MSFlexGrid1.Text) -->> ERROR IS HERE!@
Next t
myrs.Update
myrs.MoveNext
Next r
End Sub