using form to get info for report (1 Viewer)

deekras

Registered User.
Local time
Today, 09:47
Joined
Jun 14, 2000
Messages
169
i am using a form to get begin and end dates for a report.
if the user does not enter a date, i want the program to tell the to enter a date. then if the end date is less than the begin date, i want it to tell the user.
if the dates are ok, i want to preview the report.
 

TGHockett

Registered User.
Local time
Today, 09:47
Joined
Aug 16, 2000
Messages
65
Probably a first good step is to use the MS help screen to get information on "validating data" (it helped me a great deal for my macros).

Then check back in here with more speicific questions if that doesnt help.

HTH

TGH
 

deekras

Registered User.
Local time
Today, 09:47
Joined
Jun 14, 2000
Messages
169
i got the coding for making sure that the dates are good and that works. But if there are no errors, (the dates are good), i need to preview the report. I can't figure out how to write that.
 

Fornatian

Dim Person
Local time
Today, 09:47
Joined
Sep 1, 2000
Messages
1,396
Put this behind the OnClick event of the openreport button:

If IsNull(Me![MyBeginDateNameField]) OR
IsNull(Me![MyEndDateNameField]) then
Msgbox "One or more parameters missing",0,"Missing Parameters"
Me![MyBeginDateNameField].SetFocus
ElseIf Me![MyBeginDateNameField]>Me![MyEndDateNameField] Then
Msgbox "The End Date CANNOT be before the start date",0,"Date Invalid"
Me![MyBeginDateNameField].SetFocus
Else
'put the open report code here
End If

Ian



[This message has been edited by Fornatian (edited 02-10-2001).]
 

Users who are viewing this thread

Top Bottom