This is a second time i post, since i had no replies on my first post, (sorry)
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, (according to the UserID
Eg:
In my main form, i have "UserID" , "firstName" , "LastName", "PhoneNumber"
In my subform , i have some transaction related to the main form, so when i hit print, it should only print only FirstName, LastName, and the transaction in the subform, not all the transactions of the whole database
I was advised to use this
dim strWhere as string
strWhere="Ref=" & forms!myform!reffield
docmd.openreport "ReportName",asviewpreview,strWhere
I'm not sure how to use these info, ? what is the ref= ? and reffield is ?
Thanks for any input, or if you have any other solutions please advise
Thanks alot
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, (according to the UserID
Eg:
In my main form, i have "UserID" , "firstName" , "LastName", "PhoneNumber"
In my subform , i have some transaction related to the main form, so when i hit print, it should only print only FirstName, LastName, and the transaction in the subform, not all the transactions of the whole database
I was advised to use this
dim strWhere as string
strWhere="Ref=" & forms!myform!reffield
docmd.openreport "ReportName",asviewpreview,strWhere
I'm not sure how to use these info, ? what is the ref= ? and reffield is ?
Thanks for any input, or if you have any other solutions please advise
Thanks alot