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!

Using combo boxes

Status
Not open for further replies.

ivalum21

MIS
Jul 14, 2004
63
US
I have two tables...Classes and Rooms. I have a form where I can add new
classes and assign it a room. The rooms never change, so I am using a combo
box to assign the classes to a room. But when I add a new class and select
a room from my combo box, it adds a new RoomID into my Rooms table along with
adding my new class.

How do I JUST add the class, and use the Room table without updating it??
 
Why not simply follow the combo wizard ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
make sure that on your toolbox the wizard button is on when you make a new combo box

Pampers.

You're never too young to learn
 
Are you pulling the Information for the Room Combobox from the Classes Table? My feeling is that you are and since the Room can be assigned to multiple classes you are getting the same room number 2 times. Your tables should look like this:

tblClasses
ClassID =Autonumber
RoomID = Number (with Lookup Combobox with values coming from the tblRooms) Use the wizard to help you create the SQL statement
ClassName= Text
etc.

tblRooms
RoomID = Autonumber
RoomName= Text

Your relationship should be a 1 to many, 1 Room can have many classes.

On your form, the values for the Combo box should come from a query that runs against the tblRooms. If you use the Lookup field and select the Autoform wizard it will automatically generate the proper combo box.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top