Run-Time error 5

  • Thread starter Thread starter nadesico
  • Start date Start date
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
 
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
 
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


.
 
Back
Top