Auto Fill data in textbox from Combobox selection
Where the combobox is:
ManagerID stored as a number but displayed as text when selected
Location ID stored as a number but displayed as text when selected
Table Field s for Managers
ID AutoNumber
Manager Text
LocNo Number
Location Text
E-mail Address Text
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
Table to store data
RecordID AutoNumber
Date Date/Time
ManagerID Number
(ComboBox Drawing Data from Managers Table displays Text but store Number, ID & Manger)
LocationNo
(ComboBox Drawing Data from Managers Table displays Text but store Number, LocNo & Location)
LocationNo Number
Request Text
FeeID Number
Cost Currency
TicketNo Number
<o></o>
On my from I had used a Combo box For Request that when I select item the Cost auto populates from the combo box. I used the following after update code.
<o></o>
Which works great.
I tied the same logic with the manger and Location but could not get it to work.
Can this be done? Is it because ComboBox is Drawing Data from Managers Table displays Text but store Number, ID & Manger)?
<o></o>
I also tried making an unbound combo to store the value and tried the following code:
<o></o>
<o></o>
I have been at this for days. Is this possible with values that are Number but display as text?
What am I doing wrong, any incite or direction would be greatly appreciated.
Where the combobox is:
ManagerID stored as a number but displayed as text when selected
Location ID stored as a number but displayed as text when selected
Table Field s for Managers
ID AutoNumber
Manager Text
LocNo Number
Location Text
E-mail Address Text
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
Table to store data
RecordID AutoNumber
Date Date/Time
ManagerID Number
(ComboBox Drawing Data from Managers Table displays Text but store Number, ID & Manger)
LocationNo
(ComboBox Drawing Data from Managers Table displays Text but store Number, LocNo & Location)
LocationNo Number
Request Text
FeeID Number
Cost Currency
TicketNo Number
<o></o>
On my from I had used a Combo box For Request that when I select item the Cost auto populates from the combo box. I used the following after update code.
Code:
[SIZE=3][FONT=Calibri]Private Sub FeeIDCombo_AfterUpdate()[/FONT][/SIZE]
[SIZE=3][FONT=Calibri][FONT=Calibri][SIZE=3]ReAllocatedCost = DLookup("Cost", "Re-Allocated_Cost_Fee_T", "FeeID=" & FeeIDCombo)[/SIZE][/FONT]
[FONT=Calibri][SIZE=3]Me.Refresh[/SIZE][/FONT]
[FONT=Calibri][SIZE=3]End Sub[/SIZE][/FONT][/FONT][/SIZE]
Which works great.
I tied the same logic with the manger and Location but could not get it to work.
Can this be done? Is it because ComboBox is Drawing Data from Managers Table displays Text but store Number, ID & Manger)?
<o></o>
I also tried making an unbound combo to store the value and tried the following code:
Code:
[FONT=Calibri][SIZE=3]Private Sub FeeIDCombo_AfterUpdate()[/SIZE][/FONT]
[SIZE=3][FONT=Calibri][FONT=Calibri][SIZE=3]Me.ManagerIDTextBox = Me![ManagerIDComboBox].Column(0) [/SIZE][/FONT]
[FONT=Calibri][SIZE=3]Me.BranchTextBox = Me![ManagerIDComboBox].Column(1)[/SIZE][/FONT]
[FONT=Calibri][SIZE=3]Me.Refresh[/SIZE][/FONT]
[FONT=Calibri][SIZE=3]End Sub[/SIZE][/FONT][/FONT][/SIZE]
<o></o>
<o></o>
I have been at this for days. Is this possible with values that are Number but display as text?
What am I doing wrong, any incite or direction would be greatly appreciated.
Last edited: