Run-Time error 5

N

nadesico

Hi,

I am using Access 2000, and have been using a form for the past year with no
problems, then when I tried running the form today, I got a run time error 5
prompt, and I have no clue as to why this appeared. There have been no
changes recently, and I have another form that uses the same format, but to a
different report. Can anyone tell me why this is happening and how to fix
it. Any help would be greatly appreciated. Below is the code on the command
button when the run time error appears.

Thanks

Private Sub cmdAccepted_Click()
DoCmd.OpenReport "New Rejections", acViewPreview, , "Prov = '" &
[Forms]![New Rejections]![lbReport] & "'"
End Sub
 
J

Jeanette Cunningham

What happens if you try this code. Will the report open?

Private Sub cmdAccepted_Click()
DoCmd.OpenReport "New Rejections", acViewPreview
End Sub


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
N

nadesico

Hi,

If I use that code the report opens, but I want it to show only the "Prov"
chosen from the form

Jeanette Cunningham said:
What happens if you try this code. Will the report open?

Private Sub cmdAccepted_Click()
DoCmd.OpenReport "New Rejections", acViewPreview
End Sub


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia

nadesico said:
Hi,

I am using Access 2000, and have been using a form for the past year with
no
problems, then when I tried running the form today, I got a run time error
5
prompt, and I have no clue as to why this appeared. There have been no
changes recently, and I have another form that uses the same format, but
to a
different report. Can anyone tell me why this is happening and how to fix
it. Any help would be greatly appreciated. Below is the code on the
command
button when the run time error appears.

Thanks

Private Sub cmdAccepted_Click()
DoCmd.OpenReport "New Rejections", acViewPreview, , "Prov = '" &
[Forms]![New Rejections]![lbReport] & "'"
End Sub


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top