Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

code for “do nothing” 3

Status
Not open for further replies.

tech12345

Technical User
Nov 6, 2002
8
GB
Code for “Do nothing”

Is there any VBA code for “do nothing”
As an example, there is no VBA function for Is Not Null
so to carry out an action if a field is Not null

If IsNull(Fieldname) then
‘do nothing
Else DoCmd.OpenForm “Formname”
End If

This works fine with leaving the first statements blank, but doesn’t seem right???

Any observations/suggestions would be gratefully received
 
The way to do this is:


Okay = not IsNull(MyVariable)


Rollie E
 
Either of the following three contructs are valid, but, from a style standpoint, I prefer the second:
1)
Code:
If IsNull(Fieldname) then
Else
   DoCmd.OpenForm “Formname”
End If
2)
Code:
If Not IsNull(Fieldname) Then
   DoCmd.OpenForm "Formname"
End If
3)
Code:
If Not IsNull(Fieldname) Then DoCmd.OpenForm "Formname"



Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top