sja13
Professional Idiot
- Local time
- Today, 16:49
- Joined
- May 3, 2017
- Messages
- 63
I have the following code snippet in a VBA module called "ListRequested".
SetFiltersOnForm enables or disables textboxes on the Form frmReportFilter.
This works.
I am trying to use the Form frmReportFilter to allow the User to create a "Where" clause to be used in the Report.
When DoCmd.OpenForm is executed (as can be seen, I've tried different syntax on the OpenForm command.), the Form frmReportFilter is correctly formed and can be viewed in the background behind the MsgBox which is displayed immediately as the Form opens.
If I set a breakpoint at the DoCmd.OpenForm I can see that Form_Activate is invoked (it's empty).
I then get the MsgBox, and then go into DoCmd.OpenReport.
The problem is my Users don't have the chance to interact with the Form frmReportFilter.
It has the same properties as other forms which behave "correctly" (Modal=No, Pop Up=No, BorderStyle=Sizeable).
Perhaps I'm being dim here - the other Forms do what I expect them to do (they stay in focus and accept User interaction until I dismiss them via a DoCmd.Close statement behind a command button), but reading the Help on Modal and Pop Up suggests they shouldn't (at least to me!).
So I'm in a situation where Forms which apparently shouldn't wait for User input do, except for the one I'm working on now (frmReportFilter), which doesn't!
I've even tried setting frmReportFilter to Modal=True and Pop Up=True. This seems to have no effect! It's as if somewhere some other setting is overriding these properties.
Does anyone know of a "beginners guide to keeping the form in place until dismissed via a command button", or can they offer guidance.
Any help will be gratefully received....
Code:
GoSub SetFiltersOnForm
DoCmd.OpenForm ("frmReportFilter")
' DoCmd.OpenForm "frmReportFilter", acNormal
MsgBox "Back in ListRequested" & vbCrLf & _
gstrWhere
DoCmd.OpenReport strAllReport, _
acViewPreview, _
, _
gstrWhere
This works.
I am trying to use the Form frmReportFilter to allow the User to create a "Where" clause to be used in the Report.
When DoCmd.OpenForm is executed (as can be seen, I've tried different syntax on the OpenForm command.), the Form frmReportFilter is correctly formed and can be viewed in the background behind the MsgBox which is displayed immediately as the Form opens.
If I set a breakpoint at the DoCmd.OpenForm I can see that Form_Activate is invoked (it's empty).
I then get the MsgBox, and then go into DoCmd.OpenReport.
The problem is my Users don't have the chance to interact with the Form frmReportFilter.
It has the same properties as other forms which behave "correctly" (Modal=No, Pop Up=No, BorderStyle=Sizeable).
Perhaps I'm being dim here - the other Forms do what I expect them to do (they stay in focus and accept User interaction until I dismiss them via a DoCmd.Close statement behind a command button), but reading the Help on Modal and Pop Up suggests they shouldn't (at least to me!).
So I'm in a situation where Forms which apparently shouldn't wait for User input do, except for the one I'm working on now (frmReportFilter), which doesn't!
I've even tried setting frmReportFilter to Modal=True and Pop Up=True. This seems to have no effect! It's as if somewhere some other setting is overriding these properties.
Does anyone know of a "beginners guide to keeping the form in place until dismissed via a command button", or can they offer guidance.
Any help will be gratefully received....