select combo box first

  • Thread starter Thread starter ooxx
  • Start date Start date
O

ooxx

Hi, every

How can I have the form to know and to remind a message when on click
the command button to select the combo box first before doing anything in the
code?

Thanks,
 
Use the OnClick event of the button to check if a value was selected in the
combo, if not prompt a message and exit the code.

Something like

If IsNull(Me.[ComboName]) Then
MsgBox "Must select a value in Combo"
Me.[ComboName].SetFocus ' set the focus to the combo
Exit Sub ' Exit the code
End If
' Put your code here
 
Thank a lot.


Ofer Cohen said:
Use the OnClick event of the button to check if a value was selected in the
combo, if not prompt a message and exit the code.

Something like

If IsNull(Me.[ComboName]) Then
MsgBox "Must select a value in Combo"
Me.[ComboName].SetFocus ' set the focus to the combo
Exit Sub ' Exit the code
End If
' Put your code here


--
Good Luck
BS"D


ooxx said:
Hi, every

How can I have the form to know and to remind a message when on click
the command button to select the combo box first before doing anything in the
code?

Thanks,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top