Run a report,by date and checkbox - code help

Chimp8471

Registered User.
Local time
Today, 07:28
Joined
Mar 18, 2003
Messages
353
I have created a form that has two text boxes on on my for that are called :

WhichDaycodestartOEE

WhichDaycodeendOEE


i need to add to the code below, i want to ensure that the user has selected a daycode in the two boxes and a message box to appear if they are empty.

but i then need to add abutton to my form so that i can run the report ensuring that the 2 date boxes and a line are selected.


Option Compare Database
Option Explicit

Private Sub Options1()
Select Case Options
Case 1
DoCmd.OpenReport "LME_H0", acViewPreview
Case 2
DoCmd.OpenReport "LME_H1", acViewPreview
Case 3
DoCmd.OpenReport "LME_H2", acViewPreview
Else
MsgBox "please select a line"
End Select

End Sub


help please
 
In the OnClick Event of your button, something like...
Code:
                  If IsNull(Me.WhichDaycodestartOEE) Or IsNull(Me.WhichDaycodeendOEE) Then
                      MsgBox "Please Enter Both Start And End Code."
                  Else
                      Call Options1
                  End If
and set case1 as the default value on the options.
HTH
 
Last edited:

Users who are viewing this thread

Back
Top Bottom