J
Joan
Hi,
I have an update query that runs when the user clicks a button after they
have entered values (that records will be updated to) in several textboxes.
Below is the code behind the click event of the button. In my code, I try
to clear the textboxes after the query is ran in order for the user to add
different values and run another update query. But these lines seem to
trigger the following error messages and I can't figure out why.
"This expression is typed incorrectly or it is too compex to be evaluated.
For example, a numeric expression may contain too many complicated elements.
Try simplifying the expression by assigning parts of the expression to
variables"
Then when I click OK, another message appears from underneath the first:
"Object invalid or no longer set."
Could someone please explain why I am getting these messages?
Joan
My code:
Private Sub cmdEnter_Click()
On Error GoTo Err_cmdEnter_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "qrySendPUpdate"
DoCmd.SetWarnings False
DoCmd.OpenQuery stDocName, acViewNormal, acEdit
DoCmd.SetWarnings True
Me!txtInvoiceNum = " "
'Me!txtCertMail = ""
'Me!dteRegPapers = ""
MsgBox "Dog records on specified Invoice have been updated with the
Certified Mail number and date that were entered.", vbOKOnly
Exit_cmdEnter_Click:
Exit Sub
Err_cmdEnter_Click:
MsgBox Err.Description
Resume Exit_cmdEnter_Click
End Sub
I have an update query that runs when the user clicks a button after they
have entered values (that records will be updated to) in several textboxes.
Below is the code behind the click event of the button. In my code, I try
to clear the textboxes after the query is ran in order for the user to add
different values and run another update query. But these lines seem to
trigger the following error messages and I can't figure out why.
"This expression is typed incorrectly or it is too compex to be evaluated.
For example, a numeric expression may contain too many complicated elements.
Try simplifying the expression by assigning parts of the expression to
variables"
Then when I click OK, another message appears from underneath the first:
"Object invalid or no longer set."
Could someone please explain why I am getting these messages?
Joan
My code:
Private Sub cmdEnter_Click()
On Error GoTo Err_cmdEnter_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "qrySendPUpdate"
DoCmd.SetWarnings False
DoCmd.OpenQuery stDocName, acViewNormal, acEdit
DoCmd.SetWarnings True
Me!txtInvoiceNum = " "
'Me!txtCertMail = ""
'Me!dteRegPapers = ""
MsgBox "Dog records on specified Invoice have been updated with the
Certified Mail number and date that were entered.", vbOKOnly
Exit_cmdEnter_Click:
Exit Sub
Err_cmdEnter_Click:
MsgBox Err.Description
Resume Exit_cmdEnter_Click
End Sub