Subject: ASP Database Project
Posted By: jasmine5544 Post Date: 11/13/2003 11:16:46 AM
Ok I have this code I am working with which works fine until I try to put in curAmountDue in the formula.  (In access it is in currency format field)  Do I have to do something like with Date you have to use # instead of ', I have tried the $ sign instead and that did not work for me.  I could use help. Thanks:
Dim varMainQuery
    varMainQuery = "INSERT INTO tblMain (strRegType, strFirstName, strLastName, strBadgeName, "&_
    "strCompany, strTitle, strEmail, strPhone, strFax, strAddress1, strAddress2, strAddress3, "&_
    "strCity, strState, strZip, strCountry, strAltName, strAltEmail, strAltPhone, ysnGuest, "&_
    "strGuestFirst, strGuestLast, strHotel, dtmHA, dtmHD, strSmoking, ysnRoommate, strRoommate, "&_
    "strHotelCCNumber, strHotelExpMonth, strHotelExpYear, strDietary, memSpecial, ysnSponsor, "&_
    "strPrompted, strReferralName, strPaymentType, strPayCCNumber, strPayExpMonth, strPayExpYear, "&_
    "strPromoCode, dtmReg)" &_
    " VALUES ('"& Session("strRegType") &"','"&_
    Replace(Session("strFirstName"),"'","''") &"','"&_
    Replace(Session("strLastName"),"'","''") &"','"&_
    Replace(Session("strBadgeName"),"'","''") &"','"&_
    Replace(Session("strCompany"),"'","''") &"','"&_
    Replace(Session("strTitle"),"'","''")&"','"&_  
    Session("strEmail") &"','"&_
    Session("strPhone") &"','"&_
    Session("strFax") &"','"&_
    Replace(Session("strAddress1"),"'","''") &"','"&_
    Replace(Session("strAddress2"),"'","''") &"','"&_
    Replace(Session("strAddress3"),"'","''") &"','"& _
    Replace(Session("strCity"),"'","''") &"','"&_
    Session("strState") &"','"&_
    Session("strZip") &"','"&_
    Session("strCountry") &"','"&_
    Replace(Session("strAltName"),"'","''") &"','"&_
    Session("strAltEmail") &"','"&_
    Session("strAltPhone") &"','"&_
    Session("ysnGuest") &"','"&_
    Replace(Session("strGuestFirst"),"'","''") &"','"&_
    Replace(Session("strGuestLast"),"'","''") &"','"&_
    Session("strHotel") &"'," & varArrivalDate & ", " & varDepartureDate & ", '"&_
    Session("strSmoking") &"','"&_
    Session("ysnRoommate") &"','"&_
    Replace(Session("strRoommate"),"'","''") &"','"&_
    Session("strHotelCCNumber") &"','"&_
    Session("strHotelExpMonth") &"','"&_
    Session("strHotelExpYear") &"','"&_
    Session("strDietary") &"','"&_
    Replace(Session("memSpecial"),"'","''") &"','"&_
    Session("ysnSponsor") &"','"&_
    Session("strPrompted") &"','"&_
    Replace(Session("strReferralName"),"'","''") &"','"&_
    Session("strPaymentType") &"','"&_
    Session("strPayCCNumber") &"','"&_
    Session("strPayExpMonth") &"','"&_
    Session("strPayExpYear") &"','"&_
    Session("strPromoCode") &"', #"&_
    Date()&"#)"    
' Execute Database Insert

Reply By: KenSchaefer Reply Date: 11/13/2003 9:23:09 PM
You should not need any delimiter for a currency field - it is the same as numeric fields AFAIK

Cheers
Ken

Microsoft MVP - Windows Server (IIS)
www.adOpenStatic.com

Go to topic 6371

Return to index page 1006
Return to index page 1005
Return to index page 1004
Return to index page 1003
Return to index page 1002
Return to index page 1001
Return to index page 1000
Return to index page 999
Return to index page 998
Return to index page 997