A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Filtering from a Subform



 
 
Thread Tools Display Modes
  #1  
Old December 31st, 2004, 05:41 AM
Pete Klein
external usenet poster
 
Posts: n/a
Default 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  
Old December 31st, 2004, 06:05 AM
Sprinks
external usenet poster
 
Posts: n/a
Default

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  
Old December 31st, 2004, 05:33 PM
Pete Klein
external usenet poster
 
Posts: n/a
Default

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  
Old December 31st, 2004, 09:31 PM
Sprinks
external usenet poster
 
Posts: n/a
Default

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  
Old January 1st, 2005, 07:43 PM
Pete Klein
external usenet poster
 
Posts: n/a
Default

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  
Old January 2nd, 2005, 01:11 AM
Sprinks
external usenet poster
 
Posts: n/a
Default

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  
Old January 2nd, 2005, 06:45 PM
Pete Klein
external usenet poster
 
Posts: n/a
Default

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 08:28 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.