I have a table The contains an Yess/No column that is set false in the default value. This table gets it's entries from Program A with the following code:
DoCmd.SetWarnings False
SentSql = "INSERT INTO SentEmailTbl(Account_Number, Event, DateSent, Redempt_Value) " & _
"Values('" & GBL_Master_Id & "', '" & GBL_Event & "', # " & Now() & " #, " & coupValue & ")"
DoCmd.RunSQL SentSql
DoCmd.SetWarnings True
After inserting a record the check box is empty, and I assume is set to false.
In Program B I check to see if a coupon has been redeemed with the following code.
If RCMRs.Fields("Redempt_Flag") = True Then 'See if redeemed
DoCmd.OpenForm "frmApproval" ' If so fill out form
Dim DisDate As String
SentDate = CStr(EMailRs.Fields("DateSent"))
Dim inDate As Date
inDate = EMailRs.Fields(3)
Dim RedemDate As String
RedemDate = Format(inDate, "mm:dd:yyyy hh:mm:ss AMPM")
Forms!frmApproval.lblapproveBox.Caption = "Not Approved"
Forms!frmApproval.DenialReason.Value = "Previously Redeemed"
Forms!frmApproval.Detail.BackColor = vbRed
If the flag is False the code falls through to a routine that changes the flag from False to True. And when This runs and insert a record all is fine. But if I enter that same record again it falls through saying that this is a new record.
I have run a query against the table just to see what true and false meant and everything went well. So I must not be doing thins in the proper way.
I hope this is not too ambiguous. I could fix the problem by changing the Yes/no column to text, But I want to learn what's going on here.
Thanks in advance
jpl
DoCmd.SetWarnings False
SentSql = "INSERT INTO SentEmailTbl(Account_Number, Event, DateSent, Redempt_Value) " & _
"Values('" & GBL_Master_Id & "', '" & GBL_Event & "', # " & Now() & " #, " & coupValue & ")"
DoCmd.RunSQL SentSql
DoCmd.SetWarnings True
After inserting a record the check box is empty, and I assume is set to false.
In Program B I check to see if a coupon has been redeemed with the following code.
If RCMRs.Fields("Redempt_Flag") = True Then 'See if redeemed
DoCmd.OpenForm "frmApproval" ' If so fill out form
Dim DisDate As String
SentDate = CStr(EMailRs.Fields("DateSent"))
Dim inDate As Date
inDate = EMailRs.Fields(3)
Dim RedemDate As String
RedemDate = Format(inDate, "mm:dd:yyyy hh:mm:ss AMPM")
Forms!frmApproval.lblapproveBox.Caption = "Not Approved"
Forms!frmApproval.DenialReason.Value = "Previously Redeemed"
Forms!frmApproval.Detail.BackColor = vbRed
If the flag is False the code falls through to a routine that changes the flag from False to True. And when This runs and insert a record all is fine. But if I enter that same record again it falls through saying that this is a new record.
I have run a query against the table just to see what true and false meant and everything went well. So I must not be doing thins in the proper way.
I hope this is not too ambiguous. I could fix the problem by changing the Yes/no column to text, But I want to learn what's going on here.
Thanks in advance
jpl