gakiss2
Registered User.
- Local time
- Today, 04:31
- Joined
- Nov 21, 2018
- Messages
- 168
Trying to update a record in a table based on a click. I done something similar in another db so I copied the code then changed in the right fields expecting all to work like clockwork.
does is EVER go like that?
I am getting a type mismatch error but I can't understand what I am doing wrong. Pls help
Private Sub CmdRescind_Click()
Dim updMRR As String
' Code to rescind an MRR from the suppliers record
If MsgBox("Are you sure you want to rescind this MRR?", vbYesNo + vbQuestion) = vbYes Then
If IsNull(Me.Notes) Then
MsgBox "You must enter the reason in the Notes"
Exit Sub
End If
Else
MsgBox "No Action Taken"
Exit Sub
End If
updMRR = Me.mrr_num
MsgBox "Now we Rescind the MRR" & updMRR
** - troubleshooting code - updMRR does contain the string that I am looking for. I don't really need to use a variable but the db I pulled the code from used one so I used one here
CurrentDb.Execute "Update [NewRawImportMRRKey] Set [qty_rejected]= 0 where [mrr_num]= '" & updMRR & "'"
End Sub
I did try it out without the where clause and it behaved as expected, set qty_rejected to 0 for all records. Obviously this is not what is wanted but it did show the that statement up to the where clause is correct.
Thanks in advance.
does is EVER go like that?
I am getting a type mismatch error but I can't understand what I am doing wrong. Pls help
Private Sub CmdRescind_Click()
Dim updMRR As String
' Code to rescind an MRR from the suppliers record
If MsgBox("Are you sure you want to rescind this MRR?", vbYesNo + vbQuestion) = vbYes Then
If IsNull(Me.Notes) Then
MsgBox "You must enter the reason in the Notes"
Exit Sub
End If
Else
MsgBox "No Action Taken"
Exit Sub
End If
updMRR = Me.mrr_num
MsgBox "Now we Rescind the MRR" & updMRR
** - troubleshooting code - updMRR does contain the string that I am looking for. I don't really need to use a variable but the db I pulled the code from used one so I used one here
CurrentDb.Execute "Update [NewRawImportMRRKey] Set [qty_rejected]= 0 where [mrr_num]= '" & updMRR & "'"
End Sub
I did try it out without the where clause and it behaved as expected, set qty_rejected to 0 for all records. Obviously this is not what is wanted but it did show the that statement up to the where clause is correct.
Thanks in advance.