I have a Form with subform , In my subform i have a Print option, that allow me to print a report ,
My problem is, every time run that report, it shows all the records, of the database for that subform ,
i would like it to print only the current Record,
Eg:
In my main form, i have "UserID" , "firstName" , "LastName", "PhoneNumber"
In my subform , i have some transaction related to the main form,
I was advised to use this
dim strWhere as string
strWhere="Ref=" & forms!myform!reffield
docmd.openreport "ReportName",asviewpreview,strWhere
For the line: strWhere="Ref=" & forms!myform!reffield
what is the Ref= ? and the reffeild ?
Is that the Feild ID name ?
Thanks for any input, or if you have any other solutions please advise
Thanks alot
My problem is, every time run that report, it shows all the records, of the database for that subform ,
i would like it to print only the current Record,
Eg:
In my main form, i have "UserID" , "firstName" , "LastName", "PhoneNumber"
In my subform , i have some transaction related to the main form,
I was advised to use this
dim strWhere as string
strWhere="Ref=" & forms!myform!reffield
docmd.openreport "ReportName",asviewpreview,strWhere
For the line: strWhere="Ref=" & forms!myform!reffield
what is the Ref= ? and the reffeild ?
Is that the Feild ID name ?
Thanks for any input, or if you have any other solutions please advise
Thanks alot