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!

Combo populate different table access97

Status
Not open for further replies.

databasesrus

Technical User
May 29, 2003
35
US
I am using access 97. I have a form based on the classschedule table with a combo box from which the user can select a certain class/date/time. After the class is selected I would like the info stored in the classregistration table under the studentID.

I am trying to use the following but it isn't quite right for access 97. Can anyone see where I am off?

If Not IsNull(me.Combo1) Then Table![registration]![class}.value = me.Combo1.Columns(2)

etc.

Is this close? Thank you in advance for any help.
 
What is the data source for the form? If it is the classregistration table you can add a text box ( txtClass )and have it's data source as the Class field. It should show up as a drop-down if you go to the properties window. In the _Click or _Change events of Combo1 just put
Code:
If Not IsNull(Combo1) then txtClass = Combo1.Columns(2)
Is the combo box set up to have key field and description as it's two columns? If it is, are you sure you want to have the description in the classregistration table? Usually you would hold only the first field as a foreign key.

PeteJ
(Contract Code-monkey)

It's amazing how many ways there are to skin a cat
(apologies to the veggies)
 
thanks for your help but i have to call the table i want it stored in. the datasource for the combo box is a table which lists all classes available. When the user chooses the class/day/time i need it to store in another table called registration. so in my code i need the syntax to define the table it goes to. i have done it in 2000 but access97 seems to be a bit more picky.

thank you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top