Hello!
I have read and reread similar threads about autofilling fields based on a combobox but I just can't get it to work. I am new to Access, but have created a database and so far have gotten by with just using macros. I am trying to speed up the data entry and have just starting getting into coding, but I can't get any of my codes to work!
Here's my problem:
I have a form called "Implementations." It is based on table "Client Site Information." I have created a combobox in the form called CboAnalystAssigned and at the last minute I decided I want the selection of that combobox to populate a new field on the form called Txtanalystphone. I also would like the selection in the combobox of "Analyst Assigned" and the autofilled "Analyst PHone Number" to be filled into their corresponding columns in the table "Client Site Information."
So far what I have done is create a separate table called "AnalystphoneNumbers" listing the "AnalystAssigned" names and the "Analyst Phone numbers." AnalystAssigned is the primary key. I have linked the AnalystPhoneNumbers table to the Client Site information table by the AnalystAssigned field.
Then I set up the Combobox (CboAnalystAssigned) with two columns, the first is AnalystAssigned and second is AnalystPhone. The Combo box has a Row Source of SELECT AnalystAssigned, AnalystPhone, FROM AnalystPhoneNumbers ORDER BY AnalystAssigned.
And in the After Update Event of the combobox I have entered:
Private Sub CboAnalystAssigned_AfterUpdate()
Me.Txtanalystphone = Me.CboAnalystAssigned.Column(1)
End Sub
THis is the code I am constantly finding as the code to use for this issue but it does not work, nothing is populating in the Txtanalystphone field. What am I doing wrong? I appreciate any help you can give me.
I have read and reread similar threads about autofilling fields based on a combobox but I just can't get it to work. I am new to Access, but have created a database and so far have gotten by with just using macros. I am trying to speed up the data entry and have just starting getting into coding, but I can't get any of my codes to work!
Here's my problem:
I have a form called "Implementations." It is based on table "Client Site Information." I have created a combobox in the form called CboAnalystAssigned and at the last minute I decided I want the selection of that combobox to populate a new field on the form called Txtanalystphone. I also would like the selection in the combobox of "Analyst Assigned" and the autofilled "Analyst PHone Number" to be filled into their corresponding columns in the table "Client Site Information."
So far what I have done is create a separate table called "AnalystphoneNumbers" listing the "AnalystAssigned" names and the "Analyst Phone numbers." AnalystAssigned is the primary key. I have linked the AnalystPhoneNumbers table to the Client Site information table by the AnalystAssigned field.
Then I set up the Combobox (CboAnalystAssigned) with two columns, the first is AnalystAssigned and second is AnalystPhone. The Combo box has a Row Source of SELECT AnalystAssigned, AnalystPhone, FROM AnalystPhoneNumbers ORDER BY AnalystAssigned.
And in the After Update Event of the combobox I have entered:
Private Sub CboAnalystAssigned_AfterUpdate()
Me.Txtanalystphone = Me.CboAnalystAssigned.Column(1)
End Sub
THis is the code I am constantly finding as the code to use for this issue but it does not work, nothing is populating in the Txtanalystphone field. What am I doing wrong? I appreciate any help you can give me.