J
John Keith
Clicking an addAssignment button on a main form calls another popup modal
form via...
DoCmd.OpenForm "AddAssignment", , , "[SSN] = '" & Me.SSN & "'
and then fires off... the AddAssignment open event w/ the coded WHERE
condition:
Private Sub Form_Open(Cancel As Integer)
How can I detect with code here (in the open event) if the AddAssignment
form was opened from the form menu (I.E no code controlled Where condition
from the DoCmd.Openform?) When the form is run with out a Where or filter or
openarg... I need to cancel the open with a message (with no code... the form
opens as an empty frame).
I tried using the openarg parm of the DoCmd.OpenForm but once inside the
Open event... Me.OpenArg was null (even though viewing the value being passed
shows that it was a 9 dight ssn)
I tried using the filter parm, but me.filter in the open event was still a
null string (even though the form did display properly with the filtered
records.)
I need to detect:
1) Wide open recordset (form should not open and show a message why)
2) Records limited via the OpenForm (one of the 3 methods:
Filter/Where/OpenArg)
3) Records limited but none match.
Perhaps I need the Load event to check recordset conditions, but what is the
proper way to detect this in the Open (cancelable) event.
form via...
DoCmd.OpenForm "AddAssignment", , , "[SSN] = '" & Me.SSN & "'
and then fires off... the AddAssignment open event w/ the coded WHERE
condition:
Private Sub Form_Open(Cancel As Integer)
How can I detect with code here (in the open event) if the AddAssignment
form was opened from the form menu (I.E no code controlled Where condition
from the DoCmd.Openform?) When the form is run with out a Where or filter or
openarg... I need to cancel the open with a message (with no code... the form
opens as an empty frame).
I tried using the openarg parm of the DoCmd.OpenForm but once inside the
Open event... Me.OpenArg was null (even though viewing the value being passed
shows that it was a 9 dight ssn)
I tried using the filter parm, but me.filter in the open event was still a
null string (even though the form did display properly with the filtered
records.)
I need to detect:
1) Wide open recordset (form should not open and show a message why)
2) Records limited via the OpenForm (one of the 3 methods:
Filter/Where/OpenArg)
3) Records limited but none match.
Perhaps I need the Load event to check recordset conditions, but what is the
proper way to detect this in the Open (cancelable) event.