Results 1 to 3 of 3

Thread: Checkboxes and Access Databses

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 1999
    Location
    Brisbane, Qld, Australia
    Posts
    78

    Post

    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.

  2. #2
    New Member
    Join Date
    Jan 1999
    Location
    Shawnee Mission, KS
    Posts
    14

    Post

    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

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jun 1999
    Location
    Brisbane, Qld, Australia
    Posts
    78

    Post

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width