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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo Box is not updating Table

Status
Not open for further replies.

jrtaylor

Technical User
Jan 24, 2002
34
0
0
US
1. This is really puzzling me. I have a Combo Box on a form that is not updating one of the tables in the query that created the form. The combo box contains four columns: Name, Group, Area, and QuestionbyGroup. Three of the fields are now text fields. For example txtgroup = Combo76.Column(1), txtarea = Combo76.Column(2), and txtQuestionbyGroup = Combo76.Column(3). Now I want to update the tblComments from the form where txtgroup value = [tblComments] ![Group] etc. respective to the name in the txtName box on the form. The name is entering on the table but the other fields are not updating.

2. The other problem I am having is I have a popup form coming off this form for additional comments and the additional comments are not updating the table against the name they were entered against. They are going in the next available field in [tblComments]![Comments_Continued]. How do I get the comments to go against the name in the txtName on the form?

Hope this makes sense!
Thanks,
jrtaylor[spineyes]
 
The combobox can only write data from one column to whatever field you have selected as the BoundColumn. Any other columns must be placed by using code in the AfterUpdate event of the combobox. For instance:

Me.txtAnotherField = Me.Combo76.Column(1)

Steve King

Growth follows a healthy professional curiosity
 
Ok, what am I missing here? The code was added but the table is not being updated. What code can I add to the code above to so the table is updated when the information is entered?

I need the information in the Combobo to update the table.

Thanks,

jrtaylor
 
We need to know some thing first. Is the table the one that is bound to the form?? If so then that should work, otherwise use the debugger to determine what is happening. There are FAQs about using the debugger to troubleshoot code problems.

If it is in another table then it would need to be in a subform for the code to work. If it is not in a subform and the table is not connected in any way to the working form then you could use a SQL INSERT statement.

INSERT INTO
(field1, field2, field3) VALUES (4970, 'KING', 'PRINCIPAL ANALYST');

Steve King
Growth follows a healthy professional curiosity
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top