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

determining whether or not to open a report 1

Status
Not open for further replies.

dawnd3

Instructor
Jul 1, 2001
1,153
US
Hi all, I just need some help with VBA. I am not a very good coder. So, I have a report that I want to only open if there is a selection in the nearby combo box (cboEvent). If there is not a selection I want it to pop up a message and cancel the report, if there is a selection it will just do it's thing. I know I am totally off but I was trying to do it myself first. Please correct my code.

If cboEvent.Value = is null Then
MsgBox "You must first select an event!", vbOKCancel
Else
DoCmd.OpenReport stDocName, acPreview
End If

Thank you!!!

Dawn

 
Replace this:
If cboEvent.Value = is null Then
with this:
If Trim(cboEvent.Value & "") = "" Then

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Whaaa? This looks like a good way around some null problems I've encountered in the past, could you explain that?
 
This is a way to test against null, blanks and zero-length values.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top