OpenForm Command

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Within the OpenForm command, when it prompts you for the where condition
(open form to specified record): is it possible to have two where
conditions? If so, how? And when you use the DoCmd.RunCommand
accCmdDeleteRecord function, it prompts you to state whether or not you are
sure about deleting the record. Is there a way to bypass that message?
Thanks in advance.

Neil Cash
 
Two WHERE conditions? You mean
"X = Y Or Z = A" or "X = Y Or X = Z"

Just build a string that uses Or operator between the two parts of the
string.

To "intercept" the "delete confirmation" message, you need to put code on
the BeforeDelConfirm event that provides a value for the response variable:

Private Sub Form_BeforeDelConfirm(Cancel As Integer, Response As Integer)
Response = acDataErrContinue
End Sub

Note that the above code will never ask for confirmation and the delete will
progress without further delay.
 
Back
Top