Hi, I have a form(Popup/modal) that I wish to use more like
a MsgBox. It's based on a Query that takes the Value of a
textbox and searches the records input over the last 90 days
for matches. I presently have this set up as a CmdButton
and it opens properly and displays the matches( if any).
what I am trying to achieve is: call this form
( from the On Enter Event of the save button)
hidden in the background(not seen by user) and if the
ListBox contains no matches to close the form and continue
the save operation. But if there are matches to allow the
form to "POPUP" so they can review them. I've set the OK
button on the popup form & it does allows the save
operation to finish, and the CANCEL button does stop the
saving of a new record.
this is the code I'm using to open the form.
Private Sub Save_Record_Enter()
On Error GoTo Save_Record_Enter_err
DoCmd.OpenForm "frm90DayDuplicates", acNormal, , , acFormReadOnly, acDialog
Save_Record_Enter_Exit:
Exit Sub
Save_Record_Enter_err:
GlobalErrorHandler Err.Number, Erl, Err.Description, "Form_frmSprvsr", "Save_Record_Enter", ""
GoTo Save_Record_Enter_Exit
End Sub
Since its Popup and Modal I'm unsure of setting the Visible
property to false in the On Open event.
But:
Private Sub Form_Load()
DoCmd.MoveSize 0, 2000, 11800, 5000
If (IsNull([List35].Value)) Then
DoCmd.RunCommand acCmdCloseWindow
Else
Visible = True
End If
End Sub
Private Sub Form_Open(Cancel As Integer)
Visible = False
End Sub
Of Course, this does not work.... any suggestions???
Thanks in advance,
Jim
a MsgBox. It's based on a Query that takes the Value of a
textbox and searches the records input over the last 90 days
for matches. I presently have this set up as a CmdButton
and it opens properly and displays the matches( if any).
what I am trying to achieve is: call this form
( from the On Enter Event of the save button)
hidden in the background(not seen by user) and if the
ListBox contains no matches to close the form and continue
the save operation. But if there are matches to allow the
form to "POPUP" so they can review them. I've set the OK
button on the popup form & it does allows the save
operation to finish, and the CANCEL button does stop the
saving of a new record.
this is the code I'm using to open the form.
Private Sub Save_Record_Enter()
On Error GoTo Save_Record_Enter_err
DoCmd.OpenForm "frm90DayDuplicates", acNormal, , , acFormReadOnly, acDialog
Save_Record_Enter_Exit:
Exit Sub
Save_Record_Enter_err:
GlobalErrorHandler Err.Number, Erl, Err.Description, "Form_frmSprvsr", "Save_Record_Enter", ""
GoTo Save_Record_Enter_Exit
End Sub
Since its Popup and Modal I'm unsure of setting the Visible
property to false in the On Open event.
But:
Private Sub Form_Load()
DoCmd.MoveSize 0, 2000, 11800, 5000
If (IsNull([List35].Value)) Then
DoCmd.RunCommand acCmdCloseWindow
Else
Visible = True
End If
End Sub
Private Sub Form_Open(Cancel As Integer)
Visible = False
End Sub
Of Course, this does not work.... any suggestions???
Thanks in advance,
Jim