If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Filtering from a Subform
Hello,
I have been killing myself trying to get this to work. I have a relational database and I have created a main form with a subform and within that subform, another subform. The main form is the client contact information and the CustomerID. This is linked to the PurchaseOrder table that uses POnbr as it's primary key. Then the parts table is linked to the PurchaseOrder table by the PONbr. I am trying to print the customer information, PurchaseOrder information and the Parts information on one report. Now I want to create a command button that will allow me to choose a particular PO number and print all the PurchaseOrder and parts information for that PO. I cannot get my command button to filter the PO number and open the report in preview mode. Please provide any information that you can to give me some help or direction on this. Many hours spent trying with no results. THANK YOU! Pete |
#2
|
|||
|
|||
Pete,
You raise many issues. I think your fastest road to your goal is to study the Northwind database supplied with Access. Choose Help, Sample Databases, Northwind from the menus in the database window. Good luck. HTH Sprinks "Pete Klein" wrote: Hello, I have been killing myself trying to get this to work. I have a relational database and I have created a main form with a subform and within that subform, another subform. The main form is the client contact information and the CustomerID. This is linked to the PurchaseOrder table that uses POnbr as it's primary key. Then the parts table is linked to the PurchaseOrder table by the PONbr. I am trying to print the customer information, PurchaseOrder information and the Parts information on one report. Now I want to create a command button that will allow me to choose a particular PO number and print all the PurchaseOrder and parts information for that PO. I cannot get my command button to filter the PO number and open the report in preview mode. Please provide any information that you can to give me some help or direction on this. Many hours spent trying with no results. THANK YOU! Pete |
#3
|
|||
|
|||
Thanks Sprinks,
I just realized that I didn't mention something. I CAN get the report to preview and I do get information. I just get ALL of the information. The filter code in the command button is not working. Now I did place some msgbox's in the code to make sure that I am isolating the proper filter data, (i.e. the correct PONbr, etc for filtering), but when the report previews, it's as if the filter was ignored. I don't know if this information makes a difference in your advice but I thought I would throw it out there and see. Thanks again, Pete "Sprinks" wrote: Pete, You raise many issues. I think your fastest road to your goal is to study the Northwind database supplied with Access. Choose Help, Sample Databases, Northwind from the menus in the database window. Good luck. HTH Sprinks "Pete Klein" wrote: Hello, I have been killing myself trying to get this to work. I have a relational database and I have created a main form with a subform and within that subform, another subform. The main form is the client contact information and the CustomerID. This is linked to the PurchaseOrder table that uses POnbr as it's primary key. Then the parts table is linked to the PurchaseOrder table by the PONbr. I am trying to print the customer information, PurchaseOrder information and the Parts information on one report. Now I want to create a command button that will allow me to choose a particular PO number and print all the PurchaseOrder and parts information for that PO. I cannot get my command button to filter the PO number and open the report in preview mode. Please provide any information that you can to give me some help or direction on this. Many hours spent trying with no results. THANK YOU! Pete |
#4
|
|||
|
|||
Pete,
Please post your command button code. Sprinks "Pete Klein" wrote: Thanks Sprinks, I just realized that I didn't mention something. I CAN get the report to preview and I do get information. I just get ALL of the information. The filter code in the command button is not working. Now I did place some msgbox's in the code to make sure that I am isolating the proper filter data, (i.e. the correct PONbr, etc for filtering), but when the report previews, it's as if the filter was ignored. I don't know if this information makes a difference in your advice but I thought I would throw it out there and see. Thanks again, Pete "Sprinks" wrote: Pete, You raise many issues. I think your fastest road to your goal is to study the Northwind database supplied with Access. Choose Help, Sample Databases, Northwind from the menus in the database window. Good luck. HTH Sprinks "Pete Klein" wrote: Hello, I have been killing myself trying to get this to work. I have a relational database and I have created a main form with a subform and within that subform, another subform. The main form is the client contact information and the CustomerID. This is linked to the PurchaseOrder table that uses POnbr as it's primary key. Then the parts table is linked to the PurchaseOrder table by the PONbr. I am trying to print the customer information, PurchaseOrder information and the Parts information on one report. Now I want to create a command button that will allow me to choose a particular PO number and print all the PurchaseOrder and parts information for that PO. I cannot get my command button to filter the PO number and open the report in preview mode. Please provide any information that you can to give me some help or direction on this. Many hours spent trying with no results. THANK YOU! Pete |
#5
|
|||
|
|||
Sprinks,
Here is the command botton code that you requested. Thanks again. Private Sub PurchaseOrderButton_Click() DoCmd.SetWarnings False Dim strDocName1 As String Dim strFilter As String strDocName1 = "PurchaseOrder" strFilter = "PO# = Forms!PurchaseOrderForm!PO#" DoCmd.OpenReport strDocName1, acPreview, strFilter End Sub Pete "Sprinks" wrote: Pete, Please post your command button code. Sprinks "Pete Klein" wrote: Thanks Sprinks, I just realized that I didn't mention something. I CAN get the report to preview and I do get information. I just get ALL of the information. The filter code in the command button is not working. Now I did place some msgbox's in the code to make sure that I am isolating the proper filter data, (i.e. the correct PONbr, etc for filtering), but when the report previews, it's as if the filter was ignored. I don't know if this information makes a difference in your advice but I thought I would throw it out there and see. Thanks again, Pete "Sprinks" wrote: Pete, You raise many issues. I think your fastest road to your goal is to study the Northwind database supplied with Access. Choose Help, Sample Databases, Northwind from the menus in the database window. Good luck. HTH Sprinks "Pete Klein" wrote: Hello, I have been killing myself trying to get this to work. I have a relational database and I have created a main form with a subform and within that subform, another subform. The main form is the client contact information and the CustomerID. This is linked to the PurchaseOrder table that uses POnbr as it's primary key. Then the parts table is linked to the PurchaseOrder table by the PONbr. I am trying to print the customer information, PurchaseOrder information and the Parts information on one report. Now I want to create a command button that will allow me to choose a particular PO number and print all the PurchaseOrder and parts information for that PO. I cannot get my command button to filter the PO number and open the report in preview mode. Please provide any information that you can to give me some help or direction on this. Many hours spent trying with no results. THANK YOU! Pete |
#6
|
|||
|
|||
Hi, Pete.
In your assignment of the filter, you really need a reference to the PO# control on your form. With quotes around the entire string, it is just a literal. It's also good practice to delimint Access objects with brackets. Try: strFilter = "[PO#] = " & Forms![PurchaseOrderForm]![PO#] Hope that helps. Sprinks "Pete Klein" wrote: Sprinks, Here is the command botton code that you requested. Thanks again. Private Sub PurchaseOrderButton_Click() DoCmd.SetWarnings False Dim strDocName1 As String Dim strFilter As String strDocName1 = "PurchaseOrder" strFilter = "PO# = Forms!PurchaseOrderForm!PO#" DoCmd.OpenReport strDocName1, acPreview, strFilter End Sub Pete "Sprinks" wrote: Pete, Please post your command button code. Sprinks "Pete Klein" wrote: Thanks Sprinks, I just realized that I didn't mention something. I CAN get the report to preview and I do get information. I just get ALL of the information. The filter code in the command button is not working. Now I did place some msgbox's in the code to make sure that I am isolating the proper filter data, (i.e. the correct PONbr, etc for filtering), but when the report previews, it's as if the filter was ignored. I don't know if this information makes a difference in your advice but I thought I would throw it out there and see. Thanks again, Pete "Sprinks" wrote: Pete, You raise many issues. I think your fastest road to your goal is to study the Northwind database supplied with Access. Choose Help, Sample Databases, Northwind from the menus in the database window. Good luck. HTH Sprinks "Pete Klein" wrote: Hello, I have been killing myself trying to get this to work. I have a relational database and I have created a main form with a subform and within that subform, another subform. The main form is the client contact information and the CustomerID. This is linked to the PurchaseOrder table that uses POnbr as it's primary key. Then the parts table is linked to the PurchaseOrder table by the PONbr. I am trying to print the customer information, PurchaseOrder information and the Parts information on one report. Now I want to create a command button that will allow me to choose a particular PO number and print all the PurchaseOrder and parts information for that PO. I cannot get my command button to filter the PO number and open the report in preview mode. Please provide any information that you can to give me some help or direction on this. Many hours spent trying with no results. THANK YOU! Pete |
#7
|
|||
|
|||
Thank you Sprinks, I will give this a try.
Pete "Sprinks" wrote: Hi, Pete. In your assignment of the filter, you really need a reference to the PO# control on your form. With quotes around the entire string, it is just a literal. It's also good practice to delimint Access objects with brackets. Try: strFilter = "[PO#] = " & Forms![PurchaseOrderForm]![PO#] Hope that helps. Sprinks "Pete Klein" wrote: Sprinks, Here is the command botton code that you requested. Thanks again. Private Sub PurchaseOrderButton_Click() DoCmd.SetWarnings False Dim strDocName1 As String Dim strFilter As String strDocName1 = "PurchaseOrder" strFilter = "PO# = Forms!PurchaseOrderForm!PO#" DoCmd.OpenReport strDocName1, acPreview, strFilter End Sub Pete "Sprinks" wrote: Pete, Please post your command button code. Sprinks "Pete Klein" wrote: Thanks Sprinks, I just realized that I didn't mention something. I CAN get the report to preview and I do get information. I just get ALL of the information. The filter code in the command button is not working. Now I did place some msgbox's in the code to make sure that I am isolating the proper filter data, (i.e. the correct PONbr, etc for filtering), but when the report previews, it's as if the filter was ignored. I don't know if this information makes a difference in your advice but I thought I would throw it out there and see. Thanks again, Pete "Sprinks" wrote: Pete, You raise many issues. I think your fastest road to your goal is to study the Northwind database supplied with Access. Choose Help, Sample Databases, Northwind from the menus in the database window. Good luck. HTH Sprinks "Pete Klein" wrote: Hello, I have been killing myself trying to get this to work. I have a relational database and I have created a main form with a subform and within that subform, another subform. The main form is the client contact information and the CustomerID. This is linked to the PurchaseOrder table that uses POnbr as it's primary key. Then the parts table is linked to the PurchaseOrder table by the PONbr. I am trying to print the customer information, PurchaseOrder information and the Parts information on one report. Now I want to create a command button that will allow me to choose a particular PO number and print all the PurchaseOrder and parts information for that PO. I cannot get my command button to filter the PO number and open the report in preview mode. Please provide any information that you can to give me some help or direction on this. Many hours spent trying with no results. THANK YOU! Pete |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Subform Refresh Problem (but only with an unbound combo box control) | Barry Skidmore | Using Forms | 1 | December 21st, 2004 01:19 AM |
dealing with a subform record when it's "dirty" | Paul James | Using Forms | 8 | October 17th, 2004 08:45 AM |
Filtering records in a form based on data in a subform or query. | jbuck | Using Forms | 0 | August 5th, 2004 02:51 PM |
Need help with cascading combos | Tom | Using Forms | 19 | July 1st, 2004 11:11 PM |
Filtering Subform working, Requery Not Working | Emma | Using Forms | 2 | June 14th, 2004 07:01 PM |