Lookup data display

S

shank

Not sure whether this is table design or the way I'm doing the lookup. I
have a column [CompanyID] that is set to Number (Double). I'm using a query
for lookup to find data for that field. Column1 of the query is
[CompanyName], Column2 is [CompanyID]. BoundColumn = 2. In datasheet view,
[CompanyID] is being populated with [CompanyName] which is text. I expected
[CompanyID] which is a number and the BoundColumn.

1) How can text populate a number field?

2) How do I get the [CompanyID] into the [CompanyID] column?

thanks!
 
M

Michel Walsh

Hi,


1) VBA supplies the "cast", automatically.

2) In the after update event of the combo box,

Me.CompanyID=Me.ComboBoxNameHere.Column(1) ' 1 == second
column, since 0 == first one.




Hoping it may help,
Vanderghast, Access MVP
 
Top