G
Garret
Hello,
Recently I created a form to take the place of the Window's
default input dialog. This form looks almost exactly like the default
one for User Interface sake. What I usually do is have that form open
up in acDialog mode through VBA code using
Docmd.openForm DoCmd.OpenForm "frmInputBox", acNormal, , , , acDialog
However, once that code runs, no other code can run until that
form closes or does focus (through making it's visible property to
false). In the past I had the problem of wanting to display different
messages on this Input Form, so I had a HiddenKey form - an invisible
form that holds data that acts as a middle man - that had a label that
was passed the message from the calling form, then when the InputForm
opened up (on its Form_Load event) it took the message from the
HiddenKey Form. That solved that problem.
Now I have a report that has its criteria set through input on
this Input Form. In one instance, I need to collect two values, a
month and a year, and use them to have the report filtered to open
records with a particular date field that contains that month and year.
I thought I could do this by changing the Input Form to have two
(rather than one) text boxes that appear (become visible) and the other
text box becomes invisible when the form opens when called from this
particular source.
The problem here lies in that Forms with a WindowMode of Dialog
cannot run code. I tried to open the form as Normal, reset the visible
properties, and then set it back to dialog, but I get an "Invalid use
of Null" error. Is there a way to open it as normal and then just set
it's windowmode instead of trying to open it again (since that seems to
be where the error is coming from)?
Recently I created a form to take the place of the Window's
default input dialog. This form looks almost exactly like the default
one for User Interface sake. What I usually do is have that form open
up in acDialog mode through VBA code using
Docmd.openForm DoCmd.OpenForm "frmInputBox", acNormal, , , , acDialog
However, once that code runs, no other code can run until that
form closes or does focus (through making it's visible property to
false). In the past I had the problem of wanting to display different
messages on this Input Form, so I had a HiddenKey form - an invisible
form that holds data that acts as a middle man - that had a label that
was passed the message from the calling form, then when the InputForm
opened up (on its Form_Load event) it took the message from the
HiddenKey Form. That solved that problem.
Now I have a report that has its criteria set through input on
this Input Form. In one instance, I need to collect two values, a
month and a year, and use them to have the report filtered to open
records with a particular date field that contains that month and year.
I thought I could do this by changing the Input Form to have two
(rather than one) text boxes that appear (become visible) and the other
text box becomes invisible when the form opens when called from this
particular source.
The problem here lies in that Forms with a WindowMode of Dialog
cannot run code. I tried to open the form as Normal, reset the visible
properties, and then set it back to dialog, but I get an "Invalid use
of Null" error. Is there a way to open it as normal and then just set
it's windowmode instead of trying to open it again (since that seems to
be where the error is coming from)?