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

Adding "or" statement to code

Status
Not open for further replies.

Simon22

Technical User
Feb 1, 2001
54
CA
Hi all,


Here is a line of code from my search form that takes the criteria from a box on the form and checks the table

Code:
Lname = " = " & Chr(34) & Me![Last] & Chr(34) & ")"

I'm not good with VB so here is what I would like to do:

I would like to add an "or" statement somehow so that it will find records that match the entered criteria as well as those records that have a zero-length string in them. Maybe "or ''" or something along those lines.

I want to do this because it is a membership database and not everyone likes to give out their personal info but will give out their email addy. This way when a search is done to send out newsletter to specific groups, those that did not give out personal info will also recieve the newsletter just in case they fit into the specified group.

I later intend to add a check box asking if the user wants to include these extraneous records in their search but I think I can figure that out.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top