the you set a combo box with the query of Branches, and it will have 2 columns
BranchName, Vendor#
the combo properties:
bound col = 1 (this holds the name)
columns = 2 (so both columns can be used)
columnwidths = 1;0 (zero will hide the Vendor#, or you can make it visible with any #>0)
in the AFTERUPDATE event of the combo, set the textbox to the vendor#
Code:
sub cboBox_aftgerupdate()
txtBoxVendor = cboBox.column(1) 'NOTE in vb code columns start with zero. So here we are setting the vendor to col 2 in the query.
end sub