Command Button Error

amx

Registered User.
Local time
Today, 06:30
Joined
May 5, 2005
Messages
14
Hi,

I have created a command button on a form which quite simply is meant to open a report.

However I get the error, as in the attached image.

Any idea why i'm getting it, and how to get rid?! I just want the button to open a report!

Cheers
amx
 

Attachments

  • access error.jpg
    access error.jpg
    23.9 KB · Views: 192
yeah, used the command button wizard...

and also tried deleting it, and then trying again with the events on properties...

still the same...

very confused... and frustrating!

cheers
amx
 
yeah, opening the report normally works fine...

using access 2000 (version 9.0)

This is the code the wizard generates...
The button is called 'search' and is to open and preview the report, called rptSearch

.....

Private Sub Search_Click()
On Error GoTo Err_Search_Click

Dim stDocName As String

stDocName = "rptSearch"
DoCmd.OpenReport stDocName, acPreview

Exit_Search_Click:
Exit Sub

Err_Search_Click:
MsgBox Err.Description
Resume Exit_Search_Click

End Sub

....

Cheers

amx
 
nope...nothing. and rptSearch is my only report.

I was originally getting an error message relating to 'ambiguous name: Search_Click' (the command button is called Search, and is On Click) - however this isn't the error I am getting anymore! No idea why!

it's very strange!

cheers

amx
 
maybe try to compact and repair then open it again??
 
Nope that didn't work..

although what did was copying the form as another name, then renaming the original form, and then called the copied form the original name, frmSearch...

Now it all seems to work, from the new copied form... having deleted the old copy..

How incredibly bizarre

Cheers all your your help!!

amx
 
simular thing

I have suffered a simular issue in the past and solved it the same way as you however it came back it effected what appeared to be random forms in the DB

to solve it for good create a blank DB and import all your DB too it the delete the old one.

I would also check you PC for a macro virus or simular as i found some ambigous code to activiate a dialer in a hidden module.

to date i ahve not been able to find any complete answer to this although i have found many simular questions
ND
 

Users who are viewing this thread

Back
Top Bottom