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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data Validation

Status
Not open for further replies.

Guv1971

MIS
Joined
Oct 17, 2005
Messages
5
Location
US
I have created a form within Access, which allows susers to select different kinds of reports. But I need a validation check where by if the user has selected from One field (Exposure Descr id) but has not selected the business area (BusinessAreaID) then I want a message box to tell the user to go back and select the business area. Currently the code I have is shown below. This does not work.

If Me.Exposure_Descr_Id > 0 And Me.BusinessAreaId <> " " Then MsgBox "Please Select a Business Area as well as the Exposure Description before Pressing the Exposures Button"

thanks

Guv
 
How about something a bit more generic? Something like:
Code:
If IsNull(Me.Exposure_Descr_Id) Or IsNull(Me.BusinessAreaId) Then MsgBox "Please Select both a Exposure Description and a Business Area before Pressing the Exposures Button"
Hope this helps

HarleyQuinn
---------------------------------
Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
You're welcome [smile]

HarleyQuinn
---------------------------------
Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top