I have a dropdown list on my form named cmbProjNumber that displays Project Numbers. For the RowSource, I have the following SQL Statement:
SELECT [qryPopulate].[projnumber], [qryPopulate].[address], [qryPopulate].[city], [qryPopulate].[state] FROM qryPopulate;
I am displaying the values from [qryPopulate].[projnumber] in the dropdown list.
When the user selects a Project Number, the following code is executed so that the address is displayed in a text box on the form: Me!txtAdd = [Forms]![Main]![cmbProjNumber].Column(1)
I'm not saving the address, only displaying the address to the user. I am, however, saving the Project Number that the user selects from the dropdownlist.
My problem is that when the user first loads the form or browses through the records, the Project Number changes, but the Address field either displays nothing or displays the same address each time.
How can I have the address, that goes along with each Project Number, displayed when browsing through my records? (Note: My Project Number is a unique value - there are no duplicates)
I tried adding the following code to the On Current event for the form, but it does not work:
Me!txtAdd.ControlSource = "SELECT [qryPopulate].[address]FROM qryPopulate Where qryPopulate.projnumber = Me!cmbProjNumber;"
Thanks!
SELECT [qryPopulate].[projnumber], [qryPopulate].[address], [qryPopulate].[city], [qryPopulate].[state] FROM qryPopulate;
I am displaying the values from [qryPopulate].[projnumber] in the dropdown list.
When the user selects a Project Number, the following code is executed so that the address is displayed in a text box on the form: Me!txtAdd = [Forms]![Main]![cmbProjNumber].Column(1)
I'm not saving the address, only displaying the address to the user. I am, however, saving the Project Number that the user selects from the dropdownlist.
My problem is that when the user first loads the form or browses through the records, the Project Number changes, but the Address field either displays nothing or displays the same address each time.
How can I have the address, that goes along with each Project Number, displayed when browsing through my records? (Note: My Project Number is a unique value - there are no duplicates)
I tried adding the following code to the On Current event for the form, but it does not work:
Me!txtAdd.ControlSource = "SELECT [qryPopulate].[address]FROM qryPopulate Where qryPopulate.projnumber = Me!cmbProjNumber;"
Thanks!