Appending to a ComboBox

B

Bunky

I was wondering if I can have a ComboBox populated by a query but always have
the words of 'Select A Name' showing when the form loads. That way, I could
check to see if the value is 'Select A Name' to populate a message stating
'please select a valid name.

Thanks for your assistance.
 
J

Jeff Boyce

.... or you could check to see if the value is Null to determine that none
had been selected...

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or psuedocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
D

Daniel Pineault

There are ways you could do this. One of which would be to use a UNION query
to add the 'Select A Name' value to your SELECT Query.


But why not simply test if the combo box has a value as demonstrated below?

If IsNull(Me.ComboBoxName) = True then
MsgBox "'Please select a valid name"
Me.ComboBoxName.SetFocus
Exit sub
End if

--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.
 

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

Top