Print Current Record

G

Guest

How do I print the current record from a form where the table has multiple
fields for a primary key???

I was able to print current records from a form where the table has only 1
field as a primary key with the following...
strWhere = "[ID] = " & Me.[ID]
DoCmd.OpenReport "My Report", acViewPreview, , strWhere
 
M

Marshall Barton

Jet said:
How do I print the current record from a form where the table has multiple
fields for a primary key???

I was able to print current records from a form where the table has only 1
field as a primary key with the following...
strWhere = "[ID] = " & Me.[ID]
DoCmd.OpenReport "My Report", acViewPreview, , strWhere


Include all the PK fields in the WhereCondition:

strWhere = "PK1 = " & Me.Pk1 & " And PK2 = " & Me.Pk2 _
" And PK3 = " & Me.Pk3 & . . .
 
G

Guest

Thanks for your help Marsh!

Marshall Barton said:
Jet said:
How do I print the current record from a form where the table has multiple
fields for a primary key???

I was able to print current records from a form where the table has only 1
field as a primary key with the following...
strWhere = "[ID] = " & Me.[ID]
DoCmd.OpenReport "My Report", acViewPreview, , strWhere


Include all the PK fields in the WhereCondition:

strWhere = "PK1 = " & Me.Pk1 & " And PK2 = " & Me.Pk2 _
" And PK3 = " & Me.Pk3 & . . .
 

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