PDA

Click to See Complete Forum and Search --> : Checkboxes and Access Databses


Spawny
Jun 25th, 1999, 04:56 PM
How do you code checkboxes to show up whether you are adding the data by ticking the check box or editing it. I have the following code to load a checkbox in the form load section but it returns an Data Type converion error.

If Check1(0).Value Then
mRstrans!LightEater = "Yes"
Else
mRstrans!LightEater = "No"
End If
i have tried check1(0).value = 0 then , changed the no to "" and i still cant get it to work. If you have any ideas i would be greatful and will thank you in advance.

Mildumar
Jun 28th, 1999, 12:01 AM
Try "True" or "False". If you check box is bound to a field in your table besure the field data type is set to "Yes/No"

Hope this works okay for you.

Duane

Spawny
Jun 28th, 1999, 04:57 AM
Thanx Mildumar, I figured out my problem, I had the code the wrong way around and the true/false had the same error come up. The code I now use is:

If mrstrans!LightEater Then
Check1(0).Value = 1
Else
Check1(0).Value = 0
End If

This loads the checkbox with the ticks established from the database which is what I wanted it to do. But thanx anyway.