Please someone help, i have been playing with the line of code for two days and still not getting anywhere.
I have a checkbox on my form called Chkrugby when this is clicked and saved to the sql table it is saved as 1, the data type on my sql table for this is set to bit. writing the data is fine and this works well the code is below.
Set rsRemote = New ADODB.Recordset
rsRemote.Open "cadets", sqlRemote, adOpenDynamic, adLockOptimisti c
Me.Caption = "Setting values"
DoEvents
rsRemote.AddNew
rsRemote.Fields ("chkrugby") = Me.chkrugby.Val ue
rsRemote.Update
rsRemote.Close
Set myRS = Nothing
the problem is when i am trying to load the same form that has been saved i am unable to populate the chkrugby box.
i have tryed the blow but hitting a wall please can anyone help?
Me.chkrugby = rsRemote.Fields ("chkrugby")
i have also tryed
If rsRemote.Fields ("chkrugby") = 1 Then Form1.chkrugby = 1
also
If rsRemote.Fields ("chkrugby") = 1 Then Me.chkrugby = vbChecked
If rsRemote.Fields ("chkrugby") = 0 Then Me.chkrugby.Val ue = vbUnchecked
and
If rsRemote.value( "chkrugby") = 1 Then Form1.chkrugby = 1
I have a checkbox on my form called Chkrugby when this is clicked and saved to the sql table it is saved as 1, the data type on my sql table for this is set to bit. writing the data is fine and this works well the code is below.
Set rsRemote = New ADODB.Recordset
rsRemote.Open "cadets", sqlRemote, adOpenDynamic, adLockOptimisti c
Me.Caption = "Setting values"
DoEvents
rsRemote.AddNew
rsRemote.Fields ("chkrugby") = Me.chkrugby.Val ue
rsRemote.Update
rsRemote.Close
Set myRS = Nothing
the problem is when i am trying to load the same form that has been saved i am unable to populate the chkrugby box.
i have tryed the blow but hitting a wall please can anyone help?
Me.chkrugby = rsRemote.Fields ("chkrugby")
i have also tryed
If rsRemote.Fields ("chkrugby") = 1 Then Form1.chkrugby = 1
also
If rsRemote.Fields ("chkrugby") = 1 Then Me.chkrugby = vbChecked
If rsRemote.Fields ("chkrugby") = 0 Then Me.chkrugby.Val ue = vbUnchecked
and
If rsRemote.value( "chkrugby") = 1 Then Form1.chkrugby = 1
Comment