datatypes from a combo with RowSourceType=fieldlist .

X

xxewd

I have a combo with "" = "Field List", which works fine.

If a field is selected in the combo, is there any way to determine the
field's data type?

ClientTable

field DataType
ClientName Text
MonthlySalary Number

Eg click on combo, ClientName selected, I want to know it is a "text"
field, similarly click on combo, MonthlySalary selected, I want to
know it is a "Number" field.

TIA.
 
D

Douglas J. Steele

CurrentDb.TableDefs("NameOfTable").Fields("NameOfField").Type will give you
the data type, albeit as a numeric value that translates to a field type.

Select Case CurrentDb.TableDefs("NameOfTable").Fields("NameOfField").Type
Case dbBinary
MsgBox "Field is Binary"
Case dbByte
MsgBox "Field is Byte"
Case dbCurrency
MsgBox "Field is Currency
....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top