Solved

Access Combo Box - force the user to enter a value

Posted on 2009-07-07
2
315 Views
Last Modified: 2012-05-07
Hi,

I have a form with a combo box, I want to force the user to enter a value into this Field

e.g.

Combo Box(or a drop down menu)  called "Currency" has a list choice of "GBP" or "Eur"

I have the default value set to "Select Currency"

I have the properties "Limit to List" option set to "yes" So the field should only save with values of "GBP" or "EUR"

If you tab past the combo box, Access save the record with the default value ("Select Currency"), however the validation does work if you click on the field and type something other than the values in the list.

How can I get Access to look at the combo box even if the user tabs over this field and tries to save the record?

Thanks for your help.

0
Comment
Question by:squidlings
2 Comments
 
LVL 6

Accepted Solution

by:
Yadtrt earned 500 total points
ID: 24792857
Use form before update event
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.comoboxName = "Select Currency" Then
Cancel = True
MsgBox " You should Select a Currency"
End If
End Sub

Open in new window

0
 

Author Closing Comment

by:squidlings
ID: 31600534
Thanks, purrrfect.

I was putting code under the combo box not the form itself, still my code probably wasn't working anyway... Big help!  Cheers, Rich
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now