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

PARAMETER QUERY W/MULTIPLE INPUTS?

Status
Not open for further replies.

Kayo

Programmer
Aug 13, 2001
28
US
1. I've built a basic parameter query that finds one social security number at a time. When found, the resulting data set displays:

SSN, FNAME, LNAME, GRADE.

2. I need to be able to input multiple SSNs and if SSN
is found then display the above or if SSN is not found
display "record not found." Can this be done in Access 2000.


V/r,

Gregg
 
The brute-force-&-ignorance approach is to allow a comma-separated list of SSNs as user input, then use these as the argument for an IN clause. The usual furball related to embedded quotes (" or ') applies, though- caveat emptor.
 
you could also do this using a list box.
populate the list box with the SSNs.
set its multi select property to simple or extended (you would need to hold down Shift or Control and click) so you can choose more than one SSN from the list.
then, in your code, include a For Each...Next loop to cycle through the list and query for only the SSNs you have selected.

hope this helps you.
 
1. Folks, I've answered my own question. Check the following code out.
SELECT A2SF_UHGTU301ENL_INV.*
FROM A2SF_UHGTU301ENL_INV
WHERE (((A2SF_UHGTU301ENL_INV.PARTITION_ID)=54) AND ((A2SF_UHGTU301ENL_INV.EP_SSN)=[Enter SSN1])) OR (((A2SF_UHGTU301ENL_INV.PARTITION_ID)=54) AND ((A2SF_UHGTU301ENL_INV.EP_SSN)=[Enter SSN2])) OR (((A2SF_UHGTU301ENL_INV.PARTITION_ID)=54) AND ((A2SF_UHGTU301ENL_INV.EP_SSN)=[Enter SSN3])) OR (((A2SF_UHGTU301ENL_INV.PARTITION_ID)=54) AND ((A2SF_UHGTU301ENL_INV.EP_SSN)=[Enter SSN4])) OR (((A2SF_UHGTU301ENL_INV.PARTITION_ID)=54) AND ((A2SF_UHGTU301ENL_INV.EP_SSN)=[Enter SSN5])) OR (((A2SF_UHGTU301ENL_INV.PARTITION_ID)=54) AND ((A2SF_UHGTU301ENL_INV.EP_SSN)=[Enter SSN6])) OR (((A2SF_UHGTU301ENL_INV.PARTITION_ID)=54) AND ((A2SF_UHGTU301ENL_INV.EP_SSN)=[Enter SSN7])) OR (((A2SF_UHGTU301ENL_INV.PARTITION_ID)=54) AND ((A2SF_UHGTU301ENL_INV.EP_SSN)=[Enter SSN8])) OR (((A2SF_UHGTU301ENL_INV.PARTITION_ID)=54) AND ((A2SF_UHGTU301ENL_INV.EP_SSN)=[Enter SSN9])) OR (((A2SF_UHGTU301ENL_INV.PARTITION_ID)=54) AND ((A2SF_UHGTU301ENL_INV.EP_SSN)=[Enter SSN10]));
2. Next, I would like for it to prompt me "No Records
Found." when an input SSN is not found. Any help will
be appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top