Print 1 record of Report

  • Thread starter Newf via AccessMonster.com
  • Start date
N

Newf via AccessMonster.com

Good day!! I've been having a few problems with this and I'm hoping someone
can help moi. I would like to print the current record that is on the form.
P Key - Id_Personal
Push Button - frm_cmd_Print_Record
Reprt - rptTEST

Here is my code:

If Me.Dirty Then 'Save any changes.
Me.Dirty = False
End If
If Me.NewRecord Then 'Make sure there is a record to print.
MsgBox "Select the record to print"
Else
DoCmd.OpenReport "rptTEST", acViewPreview, , "Id_Personal= " & Me.Id_Personal

End If

The problem is I'm having a an error with - Me.Id_Personal
COMPILE ERROR:
Method or Data member not found.

Any ideas??

Newf
~Everyone should have a Newfie as a friend~
 
D

Duane Hookom

Is ID_Personal a field or control on the form? Is this value numeric or
text? If it is text, try:

DoCmd.OpenReport "rptTEST", acViewPreview, , "Id_Personal= """ &
Me.Id_Personal & """"
 
N

Newf via AccessMonster.com

Duane:
Never worked. Its coming up with the same error. Any other suggestions?? What
would - Me.Id_Personal & """" - mean - as in the Me part?

Newf

Duane said:
Is ID_Personal a field or control on the form? Is this value numeric or
text? If it is text, try:

DoCmd.OpenReport "rptTEST", acViewPreview, , "Id_Personal= """ &
Me.Id_Personal & """"
Good day!! I've been having a few problems with this and I'm hoping
someone
[quoted text clipped - 25 lines]
Newf
~Everyone should have a Newfie as a friend~
 
D

Duane Hookom

I asked 2 questions that were very relevant to your issue. You replied with
2 questions and no answers to my questions.

--
Duane Hookom
MS Access MVP

Newf via AccessMonster.com said:
Duane:
Never worked. Its coming up with the same error. Any other suggestions??
What
would - Me.Id_Personal & """" - mean - as in the Me part?

Newf

Duane said:
Is ID_Personal a field or control on the form? Is this value numeric or
text? If it is text, try:

DoCmd.OpenReport "rptTEST", acViewPreview, , "Id_Personal= """ &
Me.Id_Personal & """"
Good day!! I've been having a few problems with this and I'm hoping
someone
[quoted text clipped - 25 lines]
Newf
~Everyone should have a Newfie as a friend~
 
N

Newf via AccessMonster.com

Duane:
REAL SORRY!!

Id_Personal is my PK that is not on the form but is incremented automatically
so it would be numerical.

I hope this helps..

Newf

Duane said:
I asked 2 questions that were very relevant to your issue. You replied with
2 questions and no answers to my questions.
Duane:
Never worked. Its coming up with the same error. Any other suggestions??
[quoted text clipped - 14 lines]
 
D

Duane Hookom

If ID_Personal is not on the form then how does Access know which record to
print?

--
Duane Hookom
MS Access MVP

Newf via AccessMonster.com said:
Duane:
REAL SORRY!!

Id_Personal is my PK that is not on the form but is incremented
automatically
so it would be numerical.

I hope this helps..

Newf

Duane said:
I asked 2 questions that were very relevant to your issue. You replied
with
2 questions and no answers to my questions.
Duane:
Never worked. Its coming up with the same error. Any other suggestions??
[quoted text clipped - 14 lines]
Newf
~Everyone should have a Newfie as a friend~
 
N

Newf via AccessMonster.com

Id_Personal is in the tables and also in the Query but just not visible on
the form.

Duane said:
If ID_Personal is not on the form then how does Access know which record to
print?
Duane:
REAL SORRY!!
[quoted text clipped - 16 lines]
 
N

Newf via AccessMonster.com

Duane:
Ok. I placed the Id_Personal (PK) on the form and made it non-visible. Now a
pop-up appears that asks - Enter Parameter. Also it doesn't show the data
that is on the form when its in report mode.

NEWF

Duane said:
If ID_Personal is not on the form then how does Access know which record to
print?
Duane:
REAL SORRY!!
[quoted text clipped - 16 lines]
 
D

Duane Hookom

1) What is the actual name of the field and of the control?
2) What is your actual code that you are using?
3) What is the full error message?
4) Does your report's record source contain the field in your where
condition?


--
Duane Hookom
MS Access MVP

Newf via AccessMonster.com said:
Duane:
Ok. I placed the Id_Personal (PK) on the form and made it non-visible. Now
a
pop-up appears that asks - Enter Parameter. Also it doesn't show the data
that is on the form when its in report mode.

NEWF

Duane said:
If ID_Personal is not on the form then how does Access know which record
to
print?
Duane:
REAL SORRY!!
[quoted text clipped - 16 lines]
Newf
~Everyone should have a Newfie as a friend~
 

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