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

Select a single record from a recordset??

Status
Not open for further replies.

braedon

Programmer
Aug 22, 2001
7
CA
I am building a client referral tool. When a potential client makes a purchase inquiry, I want to send the inquiry request to a product dealer in the city specified by the client. I have a table with a list of dealers sorted by city.

One complication is that I need the referral tool to select only a single dealer from a list of potential dealers in that city.

My question is this: I can query the dealers with a WHERE statement to group my results on a specific city. This will give a number of results in my recordset. How do I select only a specific record from a recorset?

For example: I want to send the purchase inquiry to the first dealer in the city specified in the inquiry (dealers are sorted alphabetically). This will obviously be the first record in the recorset. The next time I want to specify that the inquiry be sent to the second record in the recordset...and so on... and so on...

Thanks
 
you can treat a query as an array and use the array syntax. so if you have a query called myquery with two columns in it Dealer, DealerID you can refer to the information as:

#myquery.dealer[1]#
#myquery.dealerID[1]#

so when you want to get the second record from the recordset just increment the number. this should do it for you.

HTH

Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top