Problem with AutoUpdate

Izzygrace3

New member
Local time
Today, 08:22
Joined
Jul 27, 2011
Messages
5
Hello. I am building a database and I seem to be stuck. I built code to autopopulate text boxes based on a combo box selection. Here is the after update code that I have on the combo box:

Private Sub Civ_Name_AfterUpdate()
Me.Organization.Value = Me![Civ_Name].Column(1)
Me.Organization.Requery
Me.[Contact_Information1] = Me.[Civ_Name].Column(2)
Me.Contact_Information1.Requery
End Sub

The first text boxes populates without a problem, but the second one will not populate. It does not give me an error message, I just don't get any data int he second combo box.

The row source of the combo box is:
SELECT QryContacts.[Full Name], QryContacts.Company, QryContacts.[Contact Information] FROM QryContacts;

Any help would be greatly appriciated.

Thanks in advance!!
 
Did you make sure to go to the combo box's COLUMN COUNT property and put 3 in there?
 
Also why are you doing a requery after setting the value of each of the controls?
 
That worked amazingly! Thank you!

The only problem is that now the combo box shows all three values instead of just the Name. Is there a way to change that?

I apologize for my ignorance. I am pretty new to Access.
 
Just set the COLUMN WIDTHS property. If you want the first column to show then:

1";0";0"
 

Users who are viewing this thread

Back
Top Bottom