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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NOT PRINT RECORD RE VBA CRITERIA

Status
Not open for further replies.

Namsha

IS-IT--Management
Mar 29, 2002
38
0
0
US
I am trying to print some records (envelopes) but don't want them to print if the po box and street are null.
I have the following code:

If IsNull(me.PO_BOX AND Me.STREET) THEN

This is where I am not sure what to put in because if they both are null I don't want to print that particular record. Any ideas would be greatly appreciated.

Nina I can expect anything and everything of myself;
But can only accept or reject what you have to offer!
 
either put a Not (1) in or put the action after the else in the if loop(2).

1.

If Not IsNull(me.PO_BOX AND Me.STREET) THEN
'do some thing e.g. print
end if

or 2.
If IsNull(me.PO_BOX AND Me.STREET) THEN
else
'Do some thing e.g. print
end if

I like 1 but you choose


 
I think I figured it out in the query.

I made up an Expr: [PO_BOX]& [STREET] and set the criteria to is not null. Thank you anyways I think your way would work also. Just looking for easier envelopes.

Nina I can expect anything and everything of myself;
But can only accept or reject what you have to offer!
 
I don't know what the logical AND of these fields will receive, but I would prefer this :

if not IsNull(me.PO_BOX) OR not isNull(Me.STREET) then
print xxxx
endif

- FirstDirk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top