goldenorb82
Registered User.
- Local time
- Today, 15:55
- Joined
- Aug 18, 2004
- Messages
- 12
Access newbie here -- i'm sorry if this question has been posted already, but i searched through the existing threads and could not seem to find an answer. My question is rather basic: I have a query constructed by the user assigned to a variable in my module like so:
strQuery = "SELECT [tblCustomer].[CustomerID], [tblCustomer].[CustomerName], [tblCustomer].[Address], [tblCustomer].[Phone], [tblCustomer]., [tblCustomer].[CustomerType], [tblCustomer].[AdditionalComments]
FROM tblCustomer INNER JOIN tblProductCustomer ON [tblCustomer].[CustomerID]=[tblProductCustomer].[Customer]
WHERE [tblProductCustomer].[License] NOT LIKE 'Perpetual'
GROUP BY [tblCustomer].[CustomerID], [tblCustomer].[CustomerName], [tblCustomer].[Address], [tblCustomer].[Phone], [tblCustomer].[Email], [tblCustomer].[CustomerType], [tblCustomer].[AdditionalComments];"
I have created a "template" Report with 7 textboxes and i want to be able to pop up this report on the fly. I first thought this would be like creating a tabular form, where you set the RecordSource of the form to "strQuery" (like frmForm.RecordSource = "strQuery") and each text box's controlSource is set to the columnname (frmForm.txtCustomerID.ControlSource = "tblCustomer.CustomerID").
I have discovered that Reports are not so easy. I can set the RecordSource of the report the same way (i think at least...) but i cannot seem to figure out how to set the ControlSource of each textbox correctly. I need the ControlSource of each textbox on the report to be set to a corresponding column name from the query above. Can someone point me in the right direction please?
Thank you so much!
strQuery = "SELECT [tblCustomer].[CustomerID], [tblCustomer].[CustomerName], [tblCustomer].[Address], [tblCustomer].[Phone], [tblCustomer]., [tblCustomer].[CustomerType], [tblCustomer].[AdditionalComments]
FROM tblCustomer INNER JOIN tblProductCustomer ON [tblCustomer].[CustomerID]=[tblProductCustomer].[Customer]
WHERE [tblProductCustomer].[License] NOT LIKE 'Perpetual'
GROUP BY [tblCustomer].[CustomerID], [tblCustomer].[CustomerName], [tblCustomer].[Address], [tblCustomer].[Phone], [tblCustomer].[Email], [tblCustomer].[CustomerType], [tblCustomer].[AdditionalComments];"
I have created a "template" Report with 7 textboxes and i want to be able to pop up this report on the fly. I first thought this would be like creating a tabular form, where you set the RecordSource of the form to "strQuery" (like frmForm.RecordSource = "strQuery") and each text box's controlSource is set to the columnname (frmForm.txtCustomerID.ControlSource = "tblCustomer.CustomerID").
I have discovered that Reports are not so easy. I can set the RecordSource of the report the same way (i think at least...) but i cannot seem to figure out how to set the ControlSource of each textbox correctly. I need the ControlSource of each textbox on the report to be set to a corresponding column name from the query above. Can someone point me in the right direction please?
Thank you so much!