msgbox combine

kitty77

Registered User.
Local time
Yesterday, 22:20
Joined
May 27, 2019
Messages
717
How do I add these two together in on line?

If ([standard] <> "apple") And ([frequency] = "annual") Then strDocName = "report1"

msgbox "all good"
 
Use a colon to combine lines
Code:
If (Me.standard <> "apple") And (Me.frequency = "annual") Then strDocName = "report1": msgbox "all good", vbInformation
 
Writing code that has multiple instructions on a single line isn't more efficient and it is extremely difficult for the reader to parse correctly.
Best practice is:
Code:
If (Me.[standard] <> "apple") And (Me.[frequency] = "annual") Then
    strDocName = "report1"
    msgbox "all good"
End If
 

Users who are viewing this thread

Back
Top Bottom