Avatar of bobrossi56
bobrossi56

asked on 

Access 2003 Query Criteria

I have a query that asks the user for a date range and a student name. This works fine. However, I want to have it show ALL students if the user leaves the student name prompt blank. is that possble?
thx experts...BobR
Microsoft Access

Avatar of undefined
Last Comment
bobrossi56
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

in the criteria for the student name, use

nz([Enter Student Name],[Student Name])

this is assuming that the name of the field you are applying the criteria is [Student Name]


post the sql of the query you are using..

Avatar of bobrossi56
bobrossi56

ASKER

SELECT tblHorseAssign.ReportDate, tblHorseAssign.HorseName, tblHorseAssign.ReportedBy, tblHorseAssign.Paid, tblHorseAssign.PaidBy, tblHorseAssign.StartTime, tblHorseAssign.EndTime, tblHorseAssign.StudentName
FROM tblHorseAssign
WHERE (((tblHorseAssign.ReportDate) Between [Enter Start Date] And [Enter End Date]) AND ((tblHorseAssign.StudentName)=nz([Enter Student Name],[Student Name])));
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of bobrossi56
bobrossi56

ASKER

Works great...thx
Microsoft Access
Microsoft Access

Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.

226K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo