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!

Recordsets and queries

Status
Not open for further replies.

Bartzilla

Technical User
Jul 16, 2004
15
DE
Alright, I am totally stuck here....
I have a database with several tables, amongst those are 'Bands', 'Labels' and 'CdDb'.

'Bands':
-id
-BandName (text)
-Website (text)

'Labels':
-id
-LabelName (text)

'CdDb':
-id
-BandId (num)
-LabelId (num)

In 'CdDb', the field "BandId" is based on the id stored in the table 'Bands' and "LabelId" is based on the id stored in table 'Labels'.
Now, I made a query in Access with these three tables. In DW I made a recordset based on this query. I am able to pull the data from the db. So far, so good.
However, I also made a detail page that should allow me to adjust the data. In that detail page, I want a listbox for the bandnames. So, basically I need a second query for the bands, compare it with the first query and set the selected band active (by passing the id), I guess.
But, what do I need for the second query and how do I compare it with the first query?
Thanks a lot!
 
Bit of guesswork here. Your detail page is for one record from the CdDb table. So your first recordset is based on that, eg
varID = request.querystring("id")
SELECT * FROM CdDb WHERE id = varID
Now you need to create 2 further recordsets for each of the Bands and Label tables both selecting everything.
Now insert a List/Menu into your page select Dynamic on the properties for the list options and have the id from the Bands recordset as the value and the BandName as the label for the menu. There is an option then to set the selected as equal to the BandId from your CdDb recordset. Repeat for the Labels menu

Cheech

[Peace][Pipe]
 
Cheech, that is exactly was I was looking for.
Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top