Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2007
    Posts
    29

    Unanswered: Form Check box switched by query

    I am filling an unbound form in sections using event handlers. Typically I have been using query to fill the row source attribute. I Would like to do this for a check box but cannot find anyway to do this. The data is question is stored in a yes/no field in the table.

    Basic idea is A part number is entered from a combo box. This part happens to be metric. The checkbox should be checked.,

    Thanks

    -Jerry

  2. #2
    Join Date
    May 2005
    Posts
    1,191
    Quote Originally Posted by sattlerjm
    I am filling an unbound form in sections using event handlers. Typically I have been using query to fill the row source attribute. I Would like to do this for a check box but cannot find anyway to do this. The data is question is stored in a yes/no field in the table.

    Basic idea is A part number is entered from a combo box. This part happens to be metric. The checkbox should be checked.,
    So when you say a "I have been using query to fill the row source attribute", do you mean for a combo box? How about on the After Update event of this combo box, do a dlookup on your table to fill in the check box, something like:
    Code:
    me.checkbox = nz(dlookup("[FldYesNo]", "TblName","[FldName] = '" & me.combobox & "'"),false)
    obviously, you'll have to change out the field/object/table names with your own, and potentially the criteria bit depending on how you've set up your dB.
    Me.Geek = True

  3. #3
    Join Date
    Jul 2007
    Posts
    29
    That worked perfectly just a little tinkering. Never done any DB work or any real VB until this little adventure. That Dlookup command is gonna get alot more use, since I can go clean up some ugly hacks I did earlier.

    Thank you so very much.

    -Jerry

  4. #4
    Join Date
    May 2005
    Posts
    1,191
    Just make sure you understand the code before you go about using it. Press F1 with your cursor in the functions to get a help file explanation on each.

    Glad I could help
    Me.Geek = True

Posting Permissions

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