How to store data from Comboboxes to a table?

croby

Registered User.
Local time
, 21:33
Joined
Feb 27, 2003
Messages
29
Hi, The Problem I stated in my reply post
( 03-02-2003 12:57 PM by croby) has been solved. I found my mis-operation. Now I can store the data values from cboSystem, cboSudsytem and cboMajor to the table called IC. The stored values are ID numbers -- column(0). Can I store the Names -- column(1) to the table IC instead of the ID numbers? Thanks. Chris
 
Yes, you can.

Look at the Bound Column property of your combobox.
 
Thanks to Mile-O-Phile for her reply. I read the BoundColumn Property from Access Help. It should store the 2nd column if I set it to 2 . Then I set this property value to 2 for all 3 Combos. What happened was, the 2nd and the 3rd Combo no longer show the list! no matter how hard I click the data in the 1st Combo. I must have been missed some thing I don’t know.

I attached the screen shot here to demo what I did. Please tell me what I possibly did wrong. Any help will be greatly appreciated! CRoby.
 

Attachments

croby said:
Thanks to Mile-O-Phile for her reply.

Well, I've been called many things but I've never been referred to as a female. :eek:

I attached the screen shot here to demo what I did. Please tell me what I possibly did wrong.

I think it would be better if you can make a small sample database with just that form and the table the info comes from as it's hard to understand just by looking at the pictures.
 
Here is my MDB

Sorry, I should have said "her/his" . I was hurry in typing and wanted to go to the dinnig room. I almost missed my lunch for these 3 Combos. I was crazy in clicking here and there, they still do not behave the way they should do. When I set the BoundColumn to 1. they work, and store the IDs to the IC table. when I set the BoundColumn to 2. They no longer work. Please feel free to change any thing you think it should be changed. You are still the only helper. I really expect you help me solve this problem. Thanks a lot! Chris

My MDB Is over 1.024 KB. I have to convert them to Excel files and Docs. will that be OK? There is no complicated codes.
 

Attachments

Remove the lines where I've put an asterisk - they are the reason that your combo box always says 0.

Code:
Private Sub cboSubsystem_AfterUpdate()
   DoCmd.Requery "cboMajor"
   *[cboMajor] = 0
End Sub

Private Sub cboSystem_AfterUpdate()
   DoCmd.Requery "cboSubsystem"
   *[cboSubsystem] = 0
   DoCmd.Requery "cboMajor"
   *[cboMajor] = 0
End Sub

Private Sub Form_Current()
   DoCmd.Requery "cboSubsystem"
   DoCmd.Requery "cboMajor"
End Sub
 
Tried

Hi, I deleted the lines you pointed, and test it. It still has a "0" there. No list came out. Do you have time to import my 3 tables to your MDB? Thanks for your prompt reply! Chris
 
You should be storing the ID as you are. Do not change the comboboxes. Whenever you need the text value, use a query that joins to the table to obtain it. The problem you hare having when you change to storing the text value is with the queries. The criteria would need to get moved from the ID fields to the text fields.
 
I've added a zipped Access 97 mdb illustrating which I think you are doing.

SubSystem name is dependent on System column 1
Process is dependent on System column 0

In any event this outght to get you started.

Note that this is a little different from my original post.

Couldn't add an attachment to respond to the private message you sent.
 

Attachments

Users who are viewing this thread

Back
Top Bottom