John, You touched on my question -- I have a form that with a print report
button; however, it prints all records. I want it to print just the record I
am viewing on the form. How do I accomplish that?
TY,
Kelvin
Your table should have a unique prime key field.
If so, code the command button's Click event:
DoCmd.OpenReport "ReportName", acViewPreview, , "[RecordID] = " &
[RecordID]
The above assumes a [RecordID] field that is a Number Datatype.
If [RecordID] is Text Datatype, then use:
"[RecordID] = '" & [RecordID] & "'"
as the Where clause.
Change the field name to whatever the actual field name is that you
are using.
See Access Help files for:
Where Clause + Restrict data to a subset of records'
Change acViewPreview to acViewNormal to print the report without first
previewing it.