467,877 Members | 1,124 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,877 developers. It's quick & easy.

Save Record From A Combo Box TO A Second Table

Greetings To All!
I am using a Access 2003 and my programing skills are of the cut and paste variety. This means begining programming skills and on a good day perhaps middle of the road intermediate. I have used some of the combo box tutorials to get me started but I have a question, how do I save a selection choice from a forms combo box into a second table where the form is recording information?

On a form called frmIncidents I have a combo box cmoLocations, that I am populating from a column, lCities in the table tblCityNames. The combo box works fine. I am trying to save the information filled out in frmIncidents in the table tblIncidents into a field called lCities.

I believe that I need to add some code to the After Update property in the cmoLocations combo box. But I do not know what to put in there. In the Cascading Combo/List Boxes tutorial there is, I believe a clue, where it sends the record information to cascade to get records from a second table to cascade to the second combo box. I think that I need a save or insert method into the table but I am not sure.

But, as I said I want the selection from cmoLocations to be saved in the lCities column of the table tblIncidents.

Could some give me some advice on how to use the After Update property to save a selected record from a forms combo box to a second table?

Thanks in advance to all who consider my problem!

Gene
Jan 17 '08 #1
  • viewed: 6155
Share:
1 Reply
jaxjagfan
Expert 100+
Greetings To All!
I am using a Access 2003 and my programing skills are of the cut and paste variety. This means begining programming skills and on a good day perhaps middle of the road intermediate. I have used some of the combo box tutorials to get me started but I have a question, how do I save a selection choice from a forms combo box into a second table where the form is recording information?

On a form called frmIncidents I have a combo box cmoLocations, that I am populating from a column, lCities in the table tblCityNames. The combo box works fine. I am trying to save the information filled out in frmIncidents in the table tblIncidents into a field called lCities.

I believe that I need to add some code to the After Update property in the cmoLocations combo box. But I do not know what to put in there. In the Cascading Combo/List Boxes tutorial there is, I believe a clue, where it sends the record information to cascade to get records from a second table to cascade to the second combo box. I think that I need a save or insert method into the table but I am not sure.

But, as I said I want the selection from cmoLocations to be saved in the lCities column of the table tblIncidents.

Could some give me some advice on how to use the After Update property to save a selected record from a forms combo box to a second table?

Thanks in advance to all who consider my problem!

Gene
Is the city name what you want to save? Is the value (I.E. city name) in the first column (or bound column) of the combo?

If frmIncidents is bound to tblIncidents and cmoLocations is on frmIncidents then bind cmoLocations to the lCities field. This will not change the rowsource of your combo. When a selection is made on a "bound" combo, it's selected value is automatically saved to the bound field - no after updates to do.

However if you want to do this via code; on the AfterUpdate property of the cmoLocations place the following code:

Me.lCities = Me.cmoLocations
Jan 17 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Andras Gilicz | last post: by
reply views Thread by jack112 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.