Form not Updating Table Properly

j2curtis64

New member
Local time
Today, 11:10
Joined
May 10, 2011
Messages
8
Hello,

I am going to try and provide more detail.

I want to do the following.

I have a combo box with a field named "Approving Official". This will contain names. In the same form i have a number field (AO_CC-text box) that i want to update automatically based on the "Approving Official" value.

I followed the instructions below.....

The Row Source of the combo box needs to include both columns (fields). You can set the width of the Number column to 0 if you don't want it to be shown when the combo box is expanded. Then, in the Control Source of the text box put;

=[YourComboBox].Column(1)

It is a zero based index, so the first column (in this case the Name field) is Column(0), the second column (in this case the Number field) is Column(1), etc.


Here is what it looks like....

Approving Official Control Source -

SELECT DISTINCT Contacts.ID, Contacts.LastName, Contacts.CC FROM Contacts WHERE (((Contacts.Position)="AO")) GROUP BY Contacts.ID, Contacts.LastName, Contacts.CC ORDER BY Contacts.LastName;

Bound column = 1

AO_CC

=[ApprovingOfficial].[Column](2)

This worked BUT when data is input in the form, the AO_CC field is NOT updating in the table. The other fields i am entering is updating in the table. The AO_CC field is not.

Why is this occuring?

Thanks
 
Why is this occuring?
Because you have used a control source of


=[ApprovingOfficial].[Column](2)

instead of binding it to a table field. To save that info you would need to bind it to the field instead of using that control source like that and then use code to do it in the AFTER UPDATE event of the Combo Box.

Me.YourControlNameHere = Me.ApprovingOfficial.Column(2)
 
This is still not working. The .txt box is not updating the table. I updated the code to the following.

Combo box - ApprovingOfficial (control source)

After Update
Private Sub ApprovingOfficial_AfterUpdate()
Me.AO_Credit_card = Me.ApprovingOfficial.Column(2)
End Sub

Text box - AO_Credit_card
Control source - AO_CARD

When I insert a name in ApprovingOfficial, it does update txt box but still does not update field in table.

What am I missing?

Thanks
 
Can you run Compact and Repair on your database and then zip it by right-clicking on the file in Windows Explorer and selecting SEND TO > COMPRESSED FOLDER? And then upload it here?
 
OK...here it is.

The Issue Details is the form I've been working on.

There are two tables (Issues and Contacts). The Issues table is empty. When data is entered it will be stored in Issues table. The contact table has names, numbers, etc....
 

Attachments

Users who are viewing this thread

Back
Top Bottom