Table Data Types?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

Is there a function that will return the Data Type for a field in a Table?

It would be great if I could set my Query RowsourceType to "Fields" and
after update, would generate the Data Type for the field chosen. Anyone know
this one?

I tried VarType() but I don't think that was it. Maybe I need to create a
Recordset and then do VartType(rst![MyField)), something like that?

Anyway, help, as always is appreciated.
 
A better way I suppose would be to

Private Sub Form_AfterUpdate()
Dim vEntry As Variant

vEntry = Me.SomeField
' return this however your needs are
MsgBox TypeName(vEntry)

End Sub

This will return the subtype being used within the Variant
What I gave before will allways return String. If you used something like
TypeName(Me.SomeField) "TextBox" would return.

doco

doco said:
Use

TypeName(Me.SomeField.Text)

doco
Bill Mitchell said:
Hi,

Is there a function that will return the Data Type for a field in a
Table?

It would be great if I could set my Query RowsourceType to "Fields" and
after update, would generate the Data Type for the field chosen. Anyone
know
this one?

I tried VarType() but I don't think that was it. Maybe I need to create
a
Recordset and then do VartType(rst![MyField)), something like that?

Anyway, help, as always is appreciated.
 
Thanks,

But I'm looking for the Data Type from the underlying table, not the Control
Type on the form.

Bill

doco said:
Use

TypeName(Me.SomeField.Text)

doco
Bill Mitchell said:
Hi,

Is there a function that will return the Data Type for a field in a Table?

It would be great if I could set my Query RowsourceType to "Fields" and
after update, would generate the Data Type for the field chosen. Anyone
know
this one?

I tried VarType() but I don't think that was it. Maybe I need to create a
Recordset and then do VartType(rst![MyField)), something like that?

Anyway, help, as always is appreciated.
 
How about Tools | Analyze | Documenter This will give you the datatype of
all fields in the table.

Bill Mitchell said:
Thanks,

But I'm looking for the Data Type from the underlying table, not the
Control
Type on the form.

Bill

doco said:
Use

TypeName(Me.SomeField.Text)

doco
Bill Mitchell said:
Hi,

Is there a function that will return the Data Type for a field in a
Table?

It would be great if I could set my Query RowsourceType to "Fields" and
after update, would generate the Data Type for the field chosen.
Anyone
know
this one?

I tried VarType() but I don't think that was it. Maybe I need to
create a
Recordset and then do VartType(rst![MyField)), something like that?

Anyway, help, as always is appreciated.
 
And, if you want to do it with code, see:
http://members.iinet.net.au/~allenbrowne/func-06.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

G. Vaught said:
How about Tools | Analyze | Documenter This will give you the datatype of
all fields in the table.

Bill Mitchell said:
Thanks,

But I'm looking for the Data Type from the underlying table, not the
Control
Type on the form.

Bill

doco said:
Use

TypeName(Me.SomeField.Text)

doco
message
Hi,

Is there a function that will return the Data Type for a field in a
Table?

It would be great if I could set my Query RowsourceType to "Fields"
and
after update, would generate the Data Type for the field chosen.
Anyone
know
this one?

I tried VarType() but I don't think that was it. Maybe I need to
create a
Recordset and then do VartType(rst![MyField)), something like that?

Anyway, help, as always is appreciated.
 
Back
Top