0

I have an Access Database, I have to do coding in the backend while users will use forms to update records. I have a field that is designated as a YesNo field. Well when I try to parameterize my code I set the parm to YesNo. When I receive the value, it comes in as -1 or (TRUE) like it should. I even tried to hardcode the parm to (TRUE). However when the insert statement executes. My record does not change and when I evaluate it after the run, the value is 0 (False). Help? I can show some of the code later. But I just don't understand, I'm passing the correct information but the insert just isn't changing the field correctly.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
dcary
  • 69
  • 6
  • 3
    Please try to provide a [mre]. With the current information, it's very hard to figure out what you're doing. – Erik A Oct 16 '19 at 11:52
  • @ErikA thank you. So when I went to upload my code. I found my issue, I declared the parm but didn't include it in the INSERT. There were 22 parms so I guess I just overlooked it. – dcary Oct 16 '19 at 12:52

1 Answers1

0

This works for me:

Sub TestYesNo
  DIM rs as Recordset
  currentdb.Execute  "CREATE TABLE Tbl1 (YesNoCol BIT)"
  currentdb.Execute "INSERT INTO Tbl1 VALUES(-1)"
  set rs=Currentdb.Openrecordset("Tbl1")
  Debug.print rs!YesNoCol
  rs.close
  currentdb.Execute  "DROP TABLE Tbl1"
End Sub
andarvi
  • 110
  • 1
  • 9