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!

Update Combo Boxes with many tables 1

Status
Not open for further replies.

mariapg

Instructor
Dec 10, 2001
7
US
Hi,

I had a question on updating combo boxes and several text boxes all based on what the user picks for the first combo box but data is from two different tables. I tried the example in the FAQ question but didn't know how to put if different tables.

Venue Table
VenueID
Venue

Location Table
LocID
VenueID
Location
Phone
Website

In my form, when the user picks a Venue from the first combo box. I would like it to automatically update the next combo box with location and then when a Location is picked I need it to automatically add the respective Phone and Website in the last two text boxes.

I may warn you I'm not that good with Access. I have tried several times and tons of event procedures. How do I delete them? I tried to look for a delete but ended up just erasing code in them.

Well, If anyone can help me I'd really appreciate it. Thanks.
 
make sure that your location combo columncount is 5

in the after update event of the venue combo box
put this code
me.locationcombo.rowsource=select LocID,VenueID,Location,
Phone,Website where venueid=" & me.venuecombo & ";"
in the after update event of the location combo box
put this code
me.txtphone=me.locationcombo.column(3)
me.txtweb=me.locationcombo.column(4)
 
When I typed in what you gave me for the Venue Combo Box I get an Compile error and it highlights the word select.

***
Private Sub Venue_AfterUpdate()
CulCalTesting.Location.rowsource=select LocID,VenueID,Location,Phone,Website where VenueID="&CulCalTesting.Venue & ";"
***

Location is the name of both Table, Table column, and combo box.

CulCalTesting is the name of the form. (I think this is what I need to put instead of me, right?)

What did I do wrong?
 
my error missing quote (") before select
sb "select.....
 
I'm still having trouble with this. I don't know what I'm doing wrong. I followed code but still getting errors. I think it may be how I created tables. I have 3 tables.

Culture Table
CultID
VenueID
LocID
StartDate
EndDate
Event

Venue Table
VenueID
Venue

Location Table
LocID
VenueID
Location
Phone
Website

I did a relationship between the VenueID's & LocID. I originally only had one table to hold all information on the Venues and Locations but ran across alot of Venues that had several Locations so I decided to separate into two tables.

The form I created has the Venue as a combo box then I needed what ever was picked for Venue to correspond to the appropriate Locations in another combo box. After Location was picked I have two text boxes that would hold their Phone and Website information.

I placed all the information you gave me but still no luck.
Also, If any one knows how I can change my profile not to say Instructor. I selected it by mistake and haven't been able to change it. I'm just a Graphic Artist/Web Designer and have little experience with programming.

Also, I wanted to buy a book on Access Databases but there are so many of them. Which would you recommend?
 
Don't worry about last question I was able to get it to work. Thanks pwise for all your help. I couldn't have figured it out with out you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top