Any fields have data run VB action

  • Thread starter Thread starter Stephen Cazzell
  • Start date Start date
S

Stephen Cazzell

Guest
The VB action below looks at a field in a Access Database. If the filed contains data then it runs the for next statement. I want this to do the same thing if any of 3 fields contain data instead of just the one field.

Private Sub Form_Current()
Dim Msg, Style, Title, Help, Ctxt, Response, MyString, OpenWo As String
If Me!OpenWo > 1 Then
Beep
Msg = "Are you taking to Clinical ?" ' Define message.
Style = vbYesNo + vbCritical + vbDefaultButton2 ' Define buttons.
Title = "Equipment on Pm Checklist" ' Define title.
' context.
' Display message.
Response = MsgBox(Msg, Style, Title)
If Response = vbYes Then ' User chose Yes.
DoCmd.OpenReport "Biomed Equipment PM"
Me!OpenWo = Null
Me!Notes = Null
Else: Response = vbNo
MsgBox ("!!Enter Note in comment!!")
End If
Else ' User chose No.

End If

End Sub

Continue reading...
 
Back
Top