Hello There,
I have created a database which has several levels of forms on it.
Here is how my database looks, these are the tables/forms that open:-
Customer (has a customerid field on it)
Computers (filters data based on customer id field)
So when i open computers i only get computers for that customer.
I have worked out how to filter the reports to only print a report for all the computers owned by a company using the following command.
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
Dim stDocName As String
Dim stDocWhere As String
stDocName = "computer"
strWhere = "[computerid]=" & Me!computerid
DoCmd.OpenReport stDocName, acNormal, , strWhere
However this prints ALL the records for computers for that customer.
I would like to only print the page which i have open so logicaly i thought... just replace customerid with computerid which is the autonumber field that the computer form uses.
However this does not work, it askes me to enter a form number for the page i want to print.
If i enter the computerid number on the page it want to print it does work, however i really want to be just hit the button and let it work.
Can anyone help?
Kind Regards
kris
I have created a database which has several levels of forms on it.
Here is how my database looks, these are the tables/forms that open:-
Customer (has a customerid field on it)
Computers (filters data based on customer id field)
So when i open computers i only get computers for that customer.
I have worked out how to filter the reports to only print a report for all the computers owned by a company using the following command.
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
Dim stDocName As String
Dim stDocWhere As String
stDocName = "computer"
strWhere = "[computerid]=" & Me!computerid
DoCmd.OpenReport stDocName, acNormal, , strWhere
However this prints ALL the records for computers for that customer.
I would like to only print the page which i have open so logicaly i thought... just replace customerid with computerid which is the autonumber field that the computer form uses.
However this does not work, it askes me to enter a form number for the page i want to print.
If i enter the computerid number on the page it want to print it does work, however i really want to be just hit the button and let it work.
Can anyone help?
Kind Regards
kris