Forum Discussion
oinorton
Sep 18, 2020Copper Contributor
Populating a field based on another field's information
Hi, I have a postal code field. With that postal code, I want to be able to fill in another field with the area of the city that correlates with. For example, TZN is North Edmonton. Is there a way t...
oinorton
Copper Contributor
I'm getting closer!! I really appreciate your help!
Here is my table:
Here is my coding:
This is my form:
What I want is the Area of City to show up in the Area of city field but the Postal code is showing up instead. I've played with the coding but I'm not getting it right.
Thanks in advance.
Woldman
Oct 21, 2020Iron Contributor
I would set the Row Source of the Three digit PC-combo box to:
SELECT [Three Digits PC], [City Location] FROM [Area of City];
And in VBA the Three_digit_PC_AfterUpdate subroutine to:
Me.Area_of_City.Value = Me.Three_digit_PC.Column(1)
Since City Location is the value you want and it's now the second column (with index 1).
Hope this work. Good luck.