Microsoft
Software
Hardware
Network
Question : How can I return an error message when a field or control is Blank
Hi experts
I am currently designing an Access form that produces a purchase order, I have a button on the form which opens a report for printing.
I want to make the report refuse to open if the operator hasn't selected their name in the "ordered by" combo box the data source for that control is a value list (of names)
I would be grateful for any help as I have spent too long trying to code it already!
Access 2007
Answer : How can I return an error message when a field or control is Blank
Hello Tintoman51,
Put a snippet like this into the Click event sub for that button:
If Nz(Me!OrderedBy, "") = "" Then
MsgBox "You must select a name to order by", vbCritical, "Invalid Entry"
Me.OrderedBy.SetFocus
Exit Sub
End If
Regards,
Patrick
Random Solutions
Fololders copy any tool that can log whats moved and does not error for long paths.
Microsoft, Sharepoint Redirect user to subsite at logon
Can't change invoice form in Microsoft Accounting Express 2007?
Excel dollar amount to text, zero fill to left, no decimal, respect 2 positions for cents
Good practice on writing file, creating directory, etc.
run regsvr32.exe on Windows 7
Excel macro to update cell information
Convert VBA to VB.Net
datetime to ISOweek & ISOyear
run a dll as an app keeps appearing when I want to do ANY window operation!