Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't write boolean to table

Status
Not open for further replies.

696796

Programmer
Aug 3, 2004
218
GB
I am setting a public boolean variable inside my code. I am then writing to my table using the following sql...

Code:
strSQl = "INSERT INTO tblTest (testDate, serialNumber, countryId, volume1, volume2, volume3, averageVolume, range, volumeAdjust, finalVolume, pass)"
        & "VALUES('" & dtDate & "' , '" & strSerial & "', '" & intCountry & "' , '" & dblVolume1 & "', '" & dblVolume2 & "', '" & dblVolume3 & "', '" & intAverage & "', '" & dblRange & "', '" & dblVolumeAdjust & "', '" & dblFinalVolume & "', '" & blnPassFail & "')"
[\code]

My pass column is datatype Yes/NO, with the format set to True/False - in the table it looks like a check box.

Now i thought by setting the variable blnPassFail to true, it should add that in using this sql, i have broken the code and all the values are there, it just doesn't tick the pass box in my table if blnPassFail is True.

Can anybody see the error in my ways??

Many thanks, 

Alex
 
Sorry, this is the sql statement...

Code:
strSQl = "INSERT INTO tblTest (testDate, serialNumber, countryId, volume1, volume2, volume3, averageVolume, range, volumeAdjust, finalVolume, pass)" _
        & "VALUES('" & dtDate & "' , '" & strSerial & "', '" & intCountry & "' , '" & dblVolume1 & "', '" & dblVolume2 & "', '" & dblVolume3 & "', '" & intAverage & "', '" & dblRange & "', '" & dblVolumeAdjust & "', '" & dblFinalVolume & "', '" & blnPassFail & "')"
 
Replace this:
& "', '" & blnPassFail & "')"
By this:
& "', " & blnPassFail & ")"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top