[dba-VB] Getting Field Type From ADO Control

Jim Lawrence (AccessD) accessd at shaw.ca
Thu Sep 11 19:29:53 CDT 2003


Hi Paul:

Using a slightly different approach you could check to see if it is a number
or string.

if not isnull((TheEnteredValue) then
    if isnumber(TheEnteredValue) then
        if int(TheEnteredValue) = TheEnteredValue then
            if  abs(TheEnteredValue)  32768 > then
                msgbox "TheEnteredValue is a long"
            else
                msgbox "TheEnteredValue is a integer"
            end if
        else
            msgbox "TheEnteredValue is a double number"
        end if
    else
        msgbox "TheEnteredValue is a string"
    end if
end if

HTH
Jim
  -----Original Message-----
  From: dba-vb-bounces at databaseadvisors.com
[mailto:dba-vb-bounces at databaseadvisors.com]On Behalf Of
paul.hartland at fsmail.net
  Sent: Thursday, September 11, 2003 3:40 AM
  To: dba-vb
  Cc: accessd
  Subject: [dba-VB] Getting Field Type From ADO Control


  To all,

  I have a field selection box in a find form that I have created myself,
but what I need to know is what datatype the field is that the user selects.

  Has anyone ever done this and can tell me how....I tried the following
line of code which runs through all the fields but it returns a number......

  MsgBox frmPersonnel.ADOPersonnel.Recordset.Fields(fldCounter).Type

  Anyone have any ideas ?

  Thanks in advance for any help received.......

  Paul Hartland

  Database Designer/Programmer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://databaseadvisors.com/pipermail/dba-vb/attachments/20030911/15cab693/attachment-0003.html>


More information about the dba-VB mailing list