Print single report

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
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]
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
Back
Top