Print single report

G

Guest

HELP!

I am using the following code under the ComandButton to print the current
report from my form:

Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[Num] = " & Me.[Num]
DoCmd.OpenReport "Check Request", acViewNormal, , strWhere
End If

However, I keep getting the following error:

The expression On Click you entered as the event property setting produced
the following error: Object or class does not support the set of events.

*The expression may not result in the name of a macro, the name of a
user-defined function, or [Event Procedure].
*There may have been an error evaluating the function, event, or macro.

The first day I used it, it worked, but for some reason unknown to me, it
stop working. I haven’t made any changes. I’ve even tried recreating the
function, but still no luck. Would really appreciate some assistance.
Thanks.
 
G

Guest

open the form in design view.
select the properties dialog for the control
be sure there is an entery in the Click event that says [Event Procedure]
 
G

Guest

There is [Event Procedure] in the On Click field.

Klatuu said:
open the form in design view.
select the properties dialog for the control
be sure there is an entery in the Click event that says [Event Procedure]
--
Dave Hargis, Microsoft Access MVP


Ellie said:
HELP!

I am using the following code under the ComandButton to print the current
report from my form:

Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[Num] = " & Me.[Num]
DoCmd.OpenReport "Check Request", acViewNormal, , strWhere
End If

However, I keep getting the following error:

The expression On Click you entered as the event property setting produced
the following error: Object or class does not support the set of events.

*The expression may not result in the name of a macro, the name of a
user-defined function, or [Event Procedure].
*There may have been an error evaluating the function, event, or macro.

The first day I used it, it worked, but for some reason unknown to me, it
stop working. I haven’t made any changes. I’ve even tried recreating the
function, but still no luck. Would really appreciate some assistance.
Thanks.
 
G

Guest

Strange. I don't see anything in your code that would cause that problem.
You may be having some minor corruption issues.
First, comment out the code and just put a message box in the click event
and see if that works.
If it does not, you may have a corruption problem.
--
Dave Hargis, Microsoft Access MVP


Ellie said:
There is [Event Procedure] in the On Click field.

Klatuu said:
open the form in design view.
select the properties dialog for the control
be sure there is an entery in the Click event that says [Event Procedure]
--
Dave Hargis, Microsoft Access MVP


Ellie said:
HELP!

I am using the following code under the ComandButton to print the current
report from my form:

Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[Num] = " & Me.[Num]
DoCmd.OpenReport "Check Request", acViewNormal, , strWhere
End If

However, I keep getting the following error:

The expression On Click you entered as the event property setting produced
the following error: Object or class does not support the set of events.

*The expression may not result in the name of a macro, the name of a
user-defined function, or [Event Procedure].
*There may have been an error evaluating the function, event, or macro.

The first day I used it, it worked, but for some reason unknown to me, it
stop working. I haven’t made any changes. I’ve even tried recreating the
function, but still no luck. Would really appreciate some assistance.
Thanks.
 
G

Guest

I know it's strange cause it worked one day and then went haywire. I do not
understand what you mean by comment out. Please explain. I am new to all
this stuff. I got the code I'm using online. Thanks.

Klatuu said:
Strange. I don't see anything in your code that would cause that problem.
You may be having some minor corruption issues.
First, comment out the code and just put a message box in the click event
and see if that works.
If it does not, you may have a corruption problem.
--
Dave Hargis, Microsoft Access MVP


Ellie said:
There is [Event Procedure] in the On Click field.

Klatuu said:
open the form in design view.
select the properties dialog for the control
be sure there is an entery in the Click event that says [Event Procedure]
--
Dave Hargis, Microsoft Access MVP


:

HELP!

I am using the following code under the ComandButton to print the current
report from my form:

Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[Num] = " & Me.[Num]
DoCmd.OpenReport "Check Request", acViewNormal, , strWhere
End If

However, I keep getting the following error:

The expression On Click you entered as the event property setting produced
the following error: Object or class does not support the set of events.

*The expression may not result in the name of a macro, the name of a
user-defined function, or [Event Procedure].
*There may have been an error evaluating the function, event, or macro.

The first day I used it, it worked, but for some reason unknown to me, it
stop working. I haven’t made any changes. I’ve even tried recreating the
function, but still no luck. Would really appreciate some assistance.
Thanks.
 
G

Guest

In the VBA editor, put a single quote mark ' at the beginning of a line. It
will turn green. That means it is a comment that will not be executed.
--
Dave Hargis, Microsoft Access MVP


Ellie said:
I know it's strange cause it worked one day and then went haywire. I do not
understand what you mean by comment out. Please explain. I am new to all
this stuff. I got the code I'm using online. Thanks.

Klatuu said:
Strange. I don't see anything in your code that would cause that problem.
You may be having some minor corruption issues.
First, comment out the code and just put a message box in the click event
and see if that works.
If it does not, you may have a corruption problem.
--
Dave Hargis, Microsoft Access MVP


Ellie said:
There is [Event Procedure] in the On Click field.

:

open the form in design view.
select the properties dialog for the control
be sure there is an entery in the Click event that says [Event Procedure]
--
Dave Hargis, Microsoft Access MVP


:

HELP!

I am using the following code under the ComandButton to print the current
report from my form:

Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[Num] = " & Me.[Num]
DoCmd.OpenReport "Check Request", acViewNormal, , strWhere
End If

However, I keep getting the following error:

The expression On Click you entered as the event property setting produced
the following error: Object or class does not support the set of events.

*The expression may not result in the name of a macro, the name of a
user-defined function, or [Event Procedure].
*There may have been an error evaluating the function, event, or macro.

The first day I used it, it worked, but for some reason unknown to me, it
stop working. I haven’t made any changes. I’ve even tried recreating the
function, but still no luck. Would really appreciate some assistance.
Thanks.
 
G

Guest

Hi Klatuu,

I believe there was some corruption. I created a new form and paste the
comand code on it and it worked. Now this did happen the first time and
stopped working the second and subsequent day. I will see what happens
tomorrow and I'll let you know. Thanks.

Ellie,


Klatuu said:
Strange. I don't see anything in your code that would cause that problem.
You may be having some minor corruption issues.
First, comment out the code and just put a message box in the click event
and see if that works.
If it does not, you may have a corruption problem.
--
Dave Hargis, Microsoft Access MVP


Ellie said:
There is [Event Procedure] in the On Click field.

Klatuu said:
open the form in design view.
select the properties dialog for the control
be sure there is an entery in the Click event that says [Event Procedure]
--
Dave Hargis, Microsoft Access MVP


:

HELP!

I am using the following code under the ComandButton to print the current
report from my form:

Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[Num] = " & Me.[Num]
DoCmd.OpenReport "Check Request", acViewNormal, , strWhere
End If

However, I keep getting the following error:

The expression On Click you entered as the event property setting produced
the following error: Object or class does not support the set of events.

*The expression may not result in the name of a macro, the name of a
user-defined function, or [Event Procedure].
*There may have been an error evaluating the function, event, or macro.

The first day I used it, it worked, but for some reason unknown to me, it
stop working. I haven’t made any changes. I’ve even tried recreating the
function, but still no luck. Would really appreciate some assistance.
Thanks.
 
G

Guest

Yes, it could be corruption.
If it continues, post back and I can send some info on recovering from
corruption.
--
Dave Hargis, Microsoft Access MVP


Ellie said:
Hi Klatuu,

I believe there was some corruption. I created a new form and paste the
comand code on it and it worked. Now this did happen the first time and
stopped working the second and subsequent day. I will see what happens
tomorrow and I'll let you know. Thanks.

Ellie,


Klatuu said:
Strange. I don't see anything in your code that would cause that problem.
You may be having some minor corruption issues.
First, comment out the code and just put a message box in the click event
and see if that works.
If it does not, you may have a corruption problem.
--
Dave Hargis, Microsoft Access MVP


Ellie said:
There is [Event Procedure] in the On Click field.

:

open the form in design view.
select the properties dialog for the control
be sure there is an entery in the Click event that says [Event Procedure]
--
Dave Hargis, Microsoft Access MVP


:

HELP!

I am using the following code under the ComandButton to print the current
report from my form:

Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[Num] = " & Me.[Num]
DoCmd.OpenReport "Check Request", acViewNormal, , strWhere
End If

However, I keep getting the following error:

The expression On Click you entered as the event property setting produced
the following error: Object or class does not support the set of events.

*The expression may not result in the name of a macro, the name of a
user-defined function, or [Event Procedure].
*There may have been an error evaluating the function, event, or macro.

The first day I used it, it worked, but for some reason unknown to me, it
stop working. I haven’t made any changes. I’ve even tried recreating the
function, but still no luck. Would really appreciate some assistance.
Thanks.
 
G

Guest

Hi Klatuu,

Everything's working this morning. Thanks for your help!

Ellie


Klatuu said:
Yes, it could be corruption.
If it continues, post back and I can send some info on recovering from
corruption.
--
Dave Hargis, Microsoft Access MVP


Ellie said:
Hi Klatuu,

I believe there was some corruption. I created a new form and paste the
comand code on it and it worked. Now this did happen the first time and
stopped working the second and subsequent day. I will see what happens
tomorrow and I'll let you know. Thanks.

Ellie,


Klatuu said:
Strange. I don't see anything in your code that would cause that problem.
You may be having some minor corruption issues.
First, comment out the code and just put a message box in the click event
and see if that works.
If it does not, you may have a corruption problem.
--
Dave Hargis, Microsoft Access MVP


:

There is [Event Procedure] in the On Click field.

:

open the form in design view.
select the properties dialog for the control
be sure there is an entery in the Click event that says [Event Procedure]
--
Dave Hargis, Microsoft Access MVP


:

HELP!

I am using the following code under the ComandButton to print the current
report from my form:

Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[Num] = " & Me.[Num]
DoCmd.OpenReport "Check Request", acViewNormal, , strWhere
End If

However, I keep getting the following error:

The expression On Click you entered as the event property setting produced
the following error: Object or class does not support the set of events.

*The expression may not result in the name of a macro, the name of a
user-defined function, or [Event Procedure].
*There may have been an error evaluating the function, event, or macro.

The first day I used it, it worked, but for some reason unknown to me, it
stop working. I haven’t made any changes. I’ve even tried recreating the
function, but still no luck. Would really appreciate some assistance.
Thanks.
 

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

Similar Threads

Printing single record 6
Print the record in the form 1
Printing Report 3
Print Preview error 12
HELP with Print Current Record 2
Printview - debug error 1
Print 2 reports 3
Print multiple reports 6

Top