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

Query Public Variable and Is Null Help

Status
Not open for further replies.

2ShotLatte

Technical User
Jul 1, 2003
7
0
0
US
Greetings

I have a query that uses a public variable (varHall). The query returns only records where tblStaff.Hall and varHall are equal. I also want the query to return all records if varHall is null. Here's what I've done so far, but I'm stumped after that.

Select tblStaff.StaffID, tbleHall
From tblStaff
WHERE (((tblStaff.Hall)=varHall()));

I've tried IsNull, but not sure if I'm getting the syntax right or just completely off. I'm hoping some Access Gods out there can help.

Thanks!
Steve
 
Fo'gitaboutit.
Word out the problem - was missing last bit of work

WHERE (((tblStaff.HallID)=qryHall())) OR ((([tblStaff].[HallID]=qryHall()) Is Null));
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top