Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populating checkbox based on combobox selection

Status
Not open for further replies.

shortone

Programmer
Mar 6, 2002
45
US
I have a checkbox that I would like to be checked automatically when a district that is found on a particular query is selected from a combobox. I'd written code on the AfterUpdate event of the District Code, but I'm not referring to the query correctly and can't seem to remember the correct syntax. Here's what I have - someone please correct my error, thanks!


Private Sub DistCode_AfterUpdate()
If Me!DistCode=DistCode("AbbottDistList"Name of query) Then
Abbott.Value=True
Else
Abbott.Value=False
End if
End Sub
 

Hi again!

I got the answer to this question in another forum (it works perfectly!) and would like to share it with everyone here:


Code:
Private Sub DistCode_AfterUpdate() 

  If IsNull(DLookup("[DistCode]","AbbottDistList","DistCode = " & ME!DistCode) = False Then 

   Abbott.Value=True 

   Else 

   Abbott.Value=False 

  End if
End Sub

Hope this helps someone else with the same problem![wavey2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top