locked
Any fields have data run VB action RRS feed

  • Question

  • 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

    Thursday, November 19, 2020 10:37 PM

All replies

  • Hello,

    This forum is for VB.NET not for VBA coding. Try using https://www.accessforums.net/


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    My GitHub code samples
    GitHub page

    Friday, November 20, 2020 12:01 AM
  • Hi Stephen Cazzell,

    Thank you for posting here.

    For VBA related questions, you can also post in the following forum for more help.

    Visual Basic for Applications (VBA)

    Best Regards,

    Xingyu Zhao


    Visual Basic and CLR forum will be migrating to a new home on Microsoft Q&A! (VB.NET and CLR) We invite you to post new questions in the new home on Microsoft Q&A ! For more information, please refer to the sticky post(VB.NET and CLR).

    Friday, November 20, 2020 1:27 AM