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!

Form--Only allow user to select one field from many drop down boxes

Status
Not open for further replies.

jprochelle

Technical User
Jun 18, 2004
36
US
I have three drop down boxes (Region, Team and Banker) and I only want the user to be able to select one search criterion. How do I validate the dropdowns so that only one can be chosen at once--and will it allow me to enter an "error message".

Also- in formatting a label in a report- how do I change the font size within the label...i.e. some text is 12pt other text is 14pt.

Thanks!
 
How about this:

Using the BeforeUpdate event for each control:

Private Sub Region_AfterUpdate()

If IsNull(Me.Team) Then
Else
msgBox "A Team has been used"
End If
If IsNull(Me.Banker) Then
Else
msgBox "A Banker has been used"
End If
End Sub

Cheers,
 
Correction!


Should be:

Private Sub Region_BeforeUpdate()
If IsNull(Me.Team) Then
Else
msgBox "A Team has been used"
End If
If IsNull(Me.Banker) Then
Else
msgBox "A Banker has been used"
End If
End Sub
 
sorry but i am not an advanced programmer. how exactly would i enter this? as an expression in the expression builder?
 
Open your form in design view
Right click on the Region combo box (select properties)
On the "Other" tab take note of the value in the "Name" field probably ComboXX.
Click on the "Event" tab and select the the first event "Before Update" Next to the dropdown arrow is a box with three (3) dots ...
When "Choose Builder" dialog appears select Code Builder
Paste the following:

If IsNull(Me.Team) Then
Else
msgBox "A Team has been used"
End If
If IsNull(Me.Banker) Then
Else
msgBox "A Banker has been used"
End If

Do the same for Team, and Banker combo boxes changing the code above for each.

Cheers,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top