Limit data entry to one of four available combo boxes

Fiona H

Registered User.
Local time
Yesterday, 21:01
Joined
Oct 25, 2006
Messages
28
Morning All!

I'm sure I've done this before but I can't remember how...

I have a form with four combo boxes on it, the four boxes all open the same form and return a record based on the selection from a different column from the same query.

To make it work smoothly I think I need to make it so it is only possible to enter data in one combo box at a time. I could also do with some error handling.

I've had a google, but I can't get the wording right to find the help I need. I would very much appreciate it if someone could point me in the right direction....

Thanks :)
 
One way would be to simply refer to ONE combo in your query.
You could also use the not in list event to add your message and or limit to list.
 
Ok, I still have two problems... First if one combo box has been completed, I would like to prevent data entry into the other 3 (this is purely aesthetic, the macro assigned to the control button opens a form based on the selected record in the matching combo box).

Second I am trying to get a message box to pop up if no data is entered. I tried to do this using a macro but it won't recognize my combo box (as either me.[Combo_AssetNo] or as Forms![FRM-MAIN]![Combo_AssetNo].

I tried to get round this by writing it as code, but I am bad at that! I have strung this together from the internet:

Private Sub BUT_SEARCH_ASSETNO_Click()
If IsNull([Forms]![FRM-MAIN]![Combo_AssetNo]) Then
MsgBox "Please Select Asset Number"
End If
DoCmd.OpenForm "FRM-SUMMARY", , , "[Asset_No], = " & Me.Combo_AssetNo

End Sub

Access says:

Runtime error 3075 Syntax error (missing operator in query expression)

If you can see what I am doing wrong, please could you tell me? :)
 

Users who are viewing this thread

Back
Top Bottom