473,486 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Save Record From A Combo Box TO A Second Table

1 New Member
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
1 6605
jaxjagfan
254 Recognized Expert Contributor
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

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

Similar topics

4
25002
by: Andras Gilicz | last post by:
Hi VB fans I'm working on a relatively large project in VB6 with about a dozen forms, including graphs, labels, text boxes, etc. The software itself is actually a flow simulator with more or...
2
3181
by: Tony Williams | last post by:
I have two tables one lists the names of committees and the other is a list of documents they generate. I have a form based on the documents table which gives details of the document including...
4
4718
by: Skully Matjas | last post by:
I am using the following code (created by the wizard) to allow to bring my form to a particular entery. But when I edit the entery (ex: put new information into a blank cell), it puts that record...
7
2249
by: Megan | last post by:
Hi everybody- I inherited a database that somehow uses a bound combo box as a record selector. Let me give you some background. The form is based on data from 2 tables. The first table, Person,...
6
2725
by: AA Arens | last post by:
Hi, I have a database with 2 main forms. Contacts and companies. I share the base with two others via LAN. On the companies form I have buttons to navigate throught the records (>400). We are...
1
1416
by: Karthiga1984 | last post by:
Hi Table Structure company name Phone No Products Example Company Name Phone No Products
5
3889
FOE2272
by: FOE2272 | last post by:
I have tried every option that I can think of and most of them on this forum. The closest that I got was to bring up the field but it changed the other records based on what was chosen in one...
4
3485
by: VMR | last post by:
I have a form that has 2 parts. Combo Box (Originator_Broker) and Text Box (Cas Number). The combo box contains the Originator Name and when one is selected it populates the Cas Number in the text...
2
3581
by: Kappucino XL | last post by:
Hi there, I have created a windows form application where I've placed a combo box; a load button and three data-grids. All these receive their data from a SQL Database. The combo box from table1. The...
0
7099
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7123
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7175
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6842
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
4864
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3069
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3070
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1378
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
262
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.