WalterInOz
Registered User.
- Local time
- Tomorrow, 04:40
- Joined
- Apr 11, 2006
- Messages
- 93
Can someone explain to me why the code below doesn't work? I think I'm doing everything right here. By clicking a button on frmFormsAndReports_period I open up the next form (frmBooks_Between_Dates),pass on the linkcriteria and then expect the first form to close. However, with the current code the first form blinks and stays on my screen, the second form doesn't open. When I remove the last 2 lines of the code opens up the next form but leaves the first form open. I don't get it, what's the problem. Is the first form closed to quickly for the criteria to be passed on?
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmBooks_Between_Dates"
DoCmd.OpenForm stDocName, , , stLinkCriteria
stDocName = "frmFormsAndReports_period"
DoCmd.close
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmBooks_Between_Dates"
DoCmd.OpenForm stDocName, , , stLinkCriteria
stDocName = "frmFormsAndReports_period"
DoCmd.close