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

weird problem

Status
Not open for further replies.

ulio

IS-IT--Management
Oct 2, 2003
28
US
hello all,

i have a form and in certain cases where data is not entered properly, i get an access error. so to fix this, i placed a "errors.clear" in the form. that worked to clear out the access error, but now my docmd string within the form does not work. i am confused.....please help.

if its worth anything.....the errors.clear and docmd are located within a button (command) click.....i dunno, i'm lost
 
A copy of the code would help

Tiny

Perfection is Everything
If it worked first time we wont be here!
 
code for ya:


Private Sub Command22_Click()
On Error GoTo Err_Command22_Click
Dim error

Errors.Clear

DoCmd.SendObject acSendNoObject, "cust", acFormatHTML, e_mail_address, , , " Help Request", "Hello! Your Ticket Number is " & Ticket_number & ". You will receive an e-mail when your request is being processed. Please do not respond to this e-mail", False


thanks for the help!!!
 
"Errors.Clear" is not a supported method in Access

Errors.Refresh is ... I think you need to trap the error and create a workaround from that to make the process tight.

Tiny


Perfection is Everything
If it worked first time we wont be here!
 
i tried that errors.refresh, same result.
 
Hi there!

It's two things:
1)Dim error
Give your variable a different name, not "error"

2)Errors.Clear
should be Err.Clear

The correct error-method is Err with Err.Description, .Number and so on.

Greetings,
MakeItSO

Andreas Galambos
EDP / Technical Support Specialist
(andreas.galambos@bowneglobal.de)
HP:
 
yea, that dim error is a mistake, scratch that. the thing of it is, the error is something i don't really understand. If a certain text box on the form is left empty, an error about not being able to find a macro comes up. i don't have any macros built for this project. so basically, if u get this error, u have to close out the form and come back into it. i would like this thing to not kill the form so to speak, rather i would like to create my own msgbox and inform the user that way...not a haulting access error. hopefully that makes a little sense.
 
Do this:

Instead of On Error GoTo Err_Command22_Click
write On Error GoTo Err_Command22

Before the End Sub, add
Err_Command22:
Do whatever here (e.g. msgbox "Oops!")
Resume Next

End Sub
;-)
Does that solve it?
 
makeitso.....unfortunately that did not work.....big thanks for taking the time to help thought!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top