Maddison2_98
New member
- Local time
- Today, 12:34
- Joined
- Mar 22, 2004
- Messages
- 5
Hi,
I have a report that when you open it, it will ask for a date range (start date and end date) and person's name, these work fine. You enter the dates, the persons name, and the report pops up. I want to be able to close the report and have the date prompt/name prompt there to enter new dates/names.
Right now I enter the date/name, the report opens, then when I close the report, I have to open the report again to get the date/name prompt. Is there a way to do this without having to do this (Enter dates/name range, open report, close report, click to open report, enter dates/name range, open report, close report, click to open report, date/name prompt, etc. every time.
This is what I have so far:
Option Compare Database
Private Sub Report_Close()
DoCmd.Close acForm, "Date Prompt 1"
DoCmd.Close acForm, "NamePrompt"
End Sub
Private Sub Report_NoData(Cancel As Integer)
On Error GoTo Error
Cancel = True
MsgBox "There is no data for " & Format(Forms![Date Prompt 1]![st_date], "mmm-dd-yyyy") & " to " & Format(Forms![Date Prompt 1]![e_date], "mmm-dd-yyyy")
Exit_Error:
Exit Sub
Error:
Resume Exit_Error
End Sub
Private Sub Report_Open(Cancel As Integer)
DoCmd.OpenForm "Date Prompt 1", , , , , acDialog
DoCmd.OpenForm "NamePrompt", , , , , acDialog
End Sub
I have a report that when you open it, it will ask for a date range (start date and end date) and person's name, these work fine. You enter the dates, the persons name, and the report pops up. I want to be able to close the report and have the date prompt/name prompt there to enter new dates/names.
Right now I enter the date/name, the report opens, then when I close the report, I have to open the report again to get the date/name prompt. Is there a way to do this without having to do this (Enter dates/name range, open report, close report, click to open report, enter dates/name range, open report, close report, click to open report, date/name prompt, etc. every time.
This is what I have so far:
Option Compare Database
Private Sub Report_Close()
DoCmd.Close acForm, "Date Prompt 1"
DoCmd.Close acForm, "NamePrompt"
End Sub
Private Sub Report_NoData(Cancel As Integer)
On Error GoTo Error
Cancel = True
MsgBox "There is no data for " & Format(Forms![Date Prompt 1]![st_date], "mmm-dd-yyyy") & " to " & Format(Forms![Date Prompt 1]![e_date], "mmm-dd-yyyy")
Exit_Error:
Exit Sub
Error:
Resume Exit_Error
End Sub
Private Sub Report_Open(Cancel As Integer)
DoCmd.OpenForm "Date Prompt 1", , , , , acDialog
DoCmd.OpenForm "NamePrompt", , , , , acDialog
End Sub