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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Value for Checkbox

Status
Not open for further replies.

kathyc20

Programmer
Mar 7, 2001
96
CA
I have a table with a checkbox in it (Yes/No) and I'm using a query to add the current record in the form to another table. sTemp(1) and (2) and strings and (3) is the value of the checkbox on the form. I display the value of sTemp(3) and got -1 (my checkbox on form was enabled). Tried to run
query and got error type conversion? How do I add this?


sSQL = ""
sSQL = sSQL & "INSERT INTO [Security Info History] "
sSQL = sSQL & "("
sSQL = sSQL & "[Employee Number], [Alarm Security Code], [Security Code Activated] "
sSQL = sSQL & ") "

sSQL = sSQL & "VALUES "
sSQL = sSQL & "("
sSQL = sSQL & "'" & sTemp(1) & "', "
sSQL = sSQL & "'" & sTemp(2) & "', "
sSQL = sSQL & sTemp(3) & " "
sSQL = sSQL & "); "
 
You need to learn to debug your code. Place this line after your final sSQL= line.
Code:
  Debug.Print
Then set a break point so that you can capture the sSQL value and paste it into a query and view the results. Viewing the sSQL might reveal an embedded quote or something.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top