How do i restrict a report to a specific record on a form?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am designing a purchasing system. I would like to be able to look at a
specific record, click a button and bring up the confirmation (report) for
that record only. I need to tie it together by PO Number. Thanks.
 
I am designing a purchasing system. I would like to be able to look at a
specific record, click a button and bring up the confirmation (report) for
that record only. I need to tie it together by PO Number. Thanks.

Each record should have a unique prime key field.
If [PO Number] is your unique field, and is Number datatype, then:

DoCmd.OpenReport "ConfirmationReport", acViewPreview, , "[PO Number] =
" & [PO Number]

However, if [PO Number] is Text datatype, then use:

DoCmd.OpenReport "ConfirmationReport", acViewPreview, , "[PO Number] =
'" & [PO Number] & "'"

Change [PO Number] to whatever the actual prime key field is.
 
I am doing something similar. In addition to displaying a specific
record on the form (as you have shown), I'd like a specific
corresponding record on a subform (derived from a linked table). I am
having trouble with the syntax for the linked field.

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

Back
Top