I have a recordset that has one value.
How do I dim it as a double to compare it to another number
I have an order form with item and Qty, my select checks the case pack for the item, to make sure they are ordering in case packs
'Declare variables
Dim Ordqty As String
Dim Item As String
Dim CPstmt As String
Dim cp As New ERSRecSet
Dim cpvalue As Double
'Dim adorecordset As New ADOBD.recordset
'adoconnect.provider = "Pervasive ODBC Client Interface"
'adoconnect.open_
'set variables
Ordqty = macForm.Qty.Text
Item = macForm.ItemNo.Text
' setup the connection string for use with the record set
p_sDataPath = "DB=" + macForm.ConnInfo.BtrPath
g_sBTRPath = macForm.ConnInfo.BtrPath
' Create a DSN-less connection to the Macola70 database.
g_sConnectString = "DRIVER=" & _
"{Macola 32-BIT Btrieve (*.dta)}; " & _
"DFE=BTR;AS=4096;" & p_sDataPath
' set the connect string here
cp.ConnectString = g_sConnectString
'Construct SQL statment
CPstmt = "SELECT IMITMIDX.USER_FIELD_4 "
CPstmt = CPstmt & "FROM IMITMIDX WHERE IMITMIDX.ITEM_NO = '" & Item & "'"
cp.open CPstmt
cpdouble = ("IMITMIDX.USER_FIELD_4"
If cpvalue = 0 Then
MsgBox "it works"
End If
End Sub
How do I dim it as a double to compare it to another number
I have an order form with item and Qty, my select checks the case pack for the item, to make sure they are ordering in case packs
'Declare variables
Dim Ordqty As String
Dim Item As String
Dim CPstmt As String
Dim cp As New ERSRecSet
Dim cpvalue As Double
'Dim adorecordset As New ADOBD.recordset
'adoconnect.provider = "Pervasive ODBC Client Interface"
'adoconnect.open_
'set variables
Ordqty = macForm.Qty.Text
Item = macForm.ItemNo.Text
' setup the connection string for use with the record set
p_sDataPath = "DB=" + macForm.ConnInfo.BtrPath
g_sBTRPath = macForm.ConnInfo.BtrPath
' Create a DSN-less connection to the Macola70 database.
g_sConnectString = "DRIVER=" & _
"{Macola 32-BIT Btrieve (*.dta)}; " & _
"DFE=BTR;AS=4096;" & p_sDataPath
' set the connect string here
cp.ConnectString = g_sConnectString
'Construct SQL statment
CPstmt = "SELECT IMITMIDX.USER_FIELD_4 "
CPstmt = CPstmt & "FROM IMITMIDX WHERE IMITMIDX.ITEM_NO = '" & Item & "'"
cp.open CPstmt
cpdouble = ("IMITMIDX.USER_FIELD_4"
If cpvalue = 0 Then
MsgBox "it works"
End If
End Sub