Welcome to Windows Help!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Subform causing duplicate records?

 
   Windows Help (Home) -> Microsoft Access RSS
Next:  Windows xp and vista  
Author Message
Cindy

External


Since: Dec 6, 2008
Posts: 4



(Msg. 1) Posted: Mon Jan 25, 2010 6:53 pm
Post subject: Subform causing duplicate records?
Archived from groups: microsoft>public>access (more info?)

I am trying to do a Purchase Order database. I need a subform in the PO Data
Entry Form since there are usually multiple items in the PO. I have a
command button to Print PO but I end up with a report for each item in the
subform.

This is the SQL for the Print PO.

SELECT DISTINCT [Purchase Order Table].[PO Number], [Purchase Order
Table].[Purchase Order Date], [Purchase Order Table].[Requested By],
[Purchase Order Table].[Approved By], [Purchase Items List Query].Quantity,
[Purchase Items List Query].Description, [Purchase Items List Query].[Unit
Price], [Purchase Items List Query].Per, [Purchase Order Table].[Estimated
Cost], [Vendor Table].Company, [Vendor Table].[Street Address], [Vendor
Table].[Street Address 2], [Vendor Table].City, [Vendor Table].State, [Vendor
Table].[Zip Code], [Vendor Table].[Phone Number], [Vendor Table].[Fax Number]
FROM ([Vendor Table] INNER JOIN [Purchase Order Table] ON ([Vendor
Table].Company = [Purchase Order Table].Vendor) AND ([Vendor Table].Company =
[Purchase Order Table].Vendor)) INNER JOIN [Purchase Items List Query] ON
[Purchase Order Table].[PO Number] = [Purchase Items List Query].[PO Number];

Can anyone help me figure out what in the heck I have done wrong here? I'm
pulling my hair out!

Thanks!
Cindy

 >> Stay informed about: Subform causing duplicate records? 
Back to top
Login to vote
Allen Browne

External


Since: Dec 2, 2008
Posts: 25



(Msg. 2) Posted: Tue Jan 26, 2010 1:25 am
Post subject: Re: Subform causing duplicate records?
Archived from groups: per prev. post (more info?)

Your query has no WHERE clause, so you've probably tried to restrict the
report by including a WHERE clause in a lower level query such as [Purchase
Items List Query].

You may find it easier to remove the criteria from that query (perhaps even
remove the query from this SQL statement), and instead use the
WhereCondition of OpenReport to restrict it to the PO in the form. Here's an
example of how that's done:
Print the record in the form
at:
[URL="http://allenbrowne.com/casu-15.html"]http://allenbrowne.com/casu-15.html[/URL]

 >> Stay informed about: Subform causing duplicate records? 
Back to top
Login to vote
Cindy

External


Since: Dec 6, 2008
Posts: 4



(Msg. 3) Posted: Tue Jan 26, 2010 10:28 am
Post subject: Re: Subform causing duplicate records?
Archived from groups: per prev. post (more info?)

Allen,

I've done some testing, changed to VBA code in your example (I use it in
another database with perfect results) and got the same result.

What I just noticed is that each item in the subform is showing as a
separate record in the form count that is on the bottom of a form. You know,
the 1 of 8, etc. I have 5 test PO's in there and it is showing 8 records.
It is not counting or showing PO #1 which has nothing in the subform but is
counting and showing PO#2 twice which has 2 items in the subform and PO#4
three times which has 3 items in the subform.

I think my problem is not the Print PO but something I've got set up wrong
in the form/subform. Since this is my first stab at subforms I'm not even
sure where to look. Any suggests?

Thanks!
Cindy

"Allen Browne" wrote:

> Your query has no WHERE clause, so you've probably tried to restrict the
> report by including a WHERE clause in a lower level query such as [Purchase
> Items List Query].
>
> You may find it easier to remove the criteria from that query (perhaps even
> remove the query from this SQL statement), and instead use the
> WhereCondition of OpenReport to restrict it to the PO in the form. Here's an
> example of how that's done:
> Print the record in the form
> at:
> [URL="http://allenbrowne.com/casu-15.html"]http://allenbrowne.com/casu-15.html[/URL]
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia
> Tips for Access users - [URL="http://allenbrowne.com/tips.html"]http://allenbrowne.com/tips.html[/URL]
> Reply to group, rather than allenbrowne at mvps dot org.
>
>
> "Cindy" wrote in message
>
> > I am trying to do a Purchase Order database. I need a subform in the PO
> > Data
> > Entry Form since there are usually multiple items in the PO. I have a
> > command button to Print PO but I end up with a report for each item in the
> > subform.
> >
> > This is the SQL for the Print PO.
> >
> SELECT DISTINCT [Purchase Order Table].[PO Number],
> [Purchase Order Table].[Purchase Order Date],
> [Purchase Order Table].[Requested By],
> [Purchase Order Table].[Approved By],
> [Purchase Items List Query].Quantity,
> [Purchase Items List Query].Description,
> [Purchase Items List Query].[Unit Price],
> [Purchase Items List Query].Per,
> [Purchase Order Table].[Estimated Cost],
> [Vendor Table].Company,
> [Vendor Table].[Street Address],
> [Vendor Table].[Street Address 2],
> [Vendor Table].City,
> [Vendor Table].State,
> [Vendor Table].[Zip Code],
> [Vendor Table].[Phone Number],
> [Vendor Table].[Fax Number]
> FROM ([Vendor Table] INNER JOIN [Purchase Order Table]
> ON ([Vendor Table].Company = [Purchase Order Table].Vendor)
> AND ([Vendor Table].Company = [Purchase Order Table].Vendor))
> INNER JOIN [Purchase Items List Query]
> ON [Purchase Order Table].[PO Number] = [Purchase Items List Query].[PO
> Number];
> >
> > Can anyone help me figure out what in the heck I have done wrong here?
> > I'm
> > pulling my hair out!
> >
> > Thanks!
> > Cindy
>
> .
>
 >> Stay informed about: Subform causing duplicate records? 
Back to top
Login to vote
Allen Browne

External


Since: Dec 2, 2008
Posts: 25



(Msg. 4) Posted: Tue Jan 26, 2010 10:25 pm
Post subject: Re: Subform causing duplicate records?
Archived from groups: per prev. post (more info?)

Does the subform use a query as its Record Source?

If so, open the query itself, and see if the records are duplicated there as
well.
 >> Stay informed about: Subform causing duplicate records? 
Back to top
Login to vote
Cindy

External


Since: Dec 6, 2008
Posts: 4



(Msg. 5) Posted: Wed Jan 27, 2010 5:59 pm
Post subject: Re: Subform causing duplicate records?
Archived from groups: per prev. post (more info?)

Allen,

Well, once again you saved the day. The problem was I had the subform
fields in the Print PO Query as well as the subform query. Removed them from
the Print PO Query and it worked perfect.

Thanks for your help.

Cindy

"Allen Browne" wrote:

> Does the subform use a query as its Record Source?
>
> If so, open the query itself, and see if the records are duplicated there as
> well.
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia
> Tips for Access users - [URL="http://allenbrowne.com/tips.html"]http://allenbrowne.com/tips.html[/URL]
> Reply to group, rather than allenbrowne at mvps dot org.
>
>
> "Cindy" wrote in message
>
> > Allen,
> >
> > I've done some testing, changed to VBA code in your example (I use it in
> > another database with perfect results) and got the same result.
> >
> > What I just noticed is that each item in the subform is showing as a
> > separate record in the form count that is on the bottom of a form. You
> > know,
> > the 1 of 8, etc. I have 5 test PO's in there and it is showing 8 records.
> > It is not counting or showing PO #1 which has nothing in the subform but
> > is
> > counting and showing PO#2 twice which has 2 items in the subform and PO#4
> > three times which has 3 items in the subform.
> >
> > I think my problem is not the Print PO but something I've got set up wrong
> > in the form/subform. Since this is my first stab at subforms I'm not even
> > sure where to look. Any suggests?
> >
> > Thanks!
> > Cindy
> >
> > "Allen Browne" wrote:
> >
> >> Your query has no WHERE clause, so you've probably tried to restrict the
> >> report by including a WHERE clause in a lower level query such as
> >> [Purchase
> >> Items List Query].
> >>
> >> You may find it easier to remove the criteria from that query (perhaps
> >> even
> >> remove the query from this SQL statement), and instead use the
> >> WhereCondition of OpenReport to restrict it to the PO in the form. Here's
> >> an
> >> example of how that's done:
> >> Print the record in the form
> >> at:
> >> [URL="http://allenbrowne.com/casu-15.html"]http://allenbrowne.com/casu-15.html[/URL]
> >>
> >> --
> >> Allen Browne - Microsoft MVP. Perth, Western Australia
> >> Tips for Access users - [URL="http://allenbrowne.com/tips.html"]http://allenbrowne.com/tips.html[/URL]
> >> Reply to group, rather than allenbrowne at mvps dot org.
> >>
> >>
> >> "Cindy" wrote in message
> >>
> >> > I am trying to do a Purchase Order database. I need a subform in the
> >> > PO
> >> > Data
> >> > Entry Form since there are usually multiple items in the PO. I have a
> >> > command button to Print PO but I end up with a report for each item in
> >> > the
> >> > subform.
> >> >
> >> > This is the SQL for the Print PO.
> >> >
> >> SELECT DISTINCT [Purchase Order Table].[PO Number],
> >> [Purchase Order Table].[Purchase Order Date],
> >> [Purchase Order Table].[Requested By],
> >> [Purchase Order Table].[Approved By],
> >> [Purchase Items List Query].Quantity,
> >> [Purchase Items List Query].Description,
> >> [Purchase Items List Query].[Unit Price],
> >> [Purchase Items List Query].Per,
> >> [Purchase Order Table].[Estimated Cost],
> >> [Vendor Table].Company,
> >> [Vendor Table].[Street Address],
> >> [Vendor Table].[Street Address 2],
> >> [Vendor Table].City,
> >> [Vendor Table].State,
> >> [Vendor Table].[Zip Code],
> >> [Vendor Table].[Phone Number],
> >> [Vendor Table].[Fax Number]
> >> FROM ([Vendor Table] INNER JOIN [Purchase Order Table]
> >> ON ([Vendor Table].Company = [Purchase Order Table].Vendor)
> >> AND ([Vendor Table].Company = [Purchase Order Table].Vendor))
> >> INNER JOIN [Purchase Items List Query]
> >> ON [Purchase Order Table].[PO Number] = [Purchase Items List Query].[PO
> >> Number];
> >> >
> >> > Can anyone help me figure out what in the heck I have done wrong here?
> >> > I'm
> >> > pulling my hair out!
> >> >
> >> > Thanks!
> >> > Cindy
> >>
> >> .
> >>
> .
>
 >> Stay informed about: Subform causing duplicate records? 
Back to top
Login to vote
Bry Anhuit

External


Since: Mar 09, 2010
Posts: 1



(Msg. 6) Posted: Tue Mar 09, 2010 1:21 pm
Post subject: PO database [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Cindy,
I am trying to develop a PO database in Access 2007. I am new to VBA and SQL, although I have some experience in Access. Everything I have ever found on the net is for tracking purchases of a customer, but I am trying to track purchases I make from my vendors.

It seems you have written that type of database.

Can you send me the table layout and table fields of your database? What I am having the most trouble with is getting the subform to work within the main form and it seems you have solved that. I can never seem to get the results I expect to get.

Any help you can send in regards to creating and printing a multi-item order would be greatly appreciated.

Thanks in advance
Bry



Cindy wrote:

Allen,Well, once again you saved the day.
27-Jan-10

Allen,

Well, once again you saved the day. The problem was I had the subform
fields in the Print PO Query as well as the subform query. Removed them from
the Print PO Query and it worked perfect.

Thanks for your help.

Cindy

"Allen Browne" wrote:

Previous Posts In This Thread:

On Monday, January 25, 2010 9:53 PM
Cindy wrote:

Subform causing duplicate records?
I am trying to do a Purchase Order database. I need a subform in the PO Data
Entry Form since there are usually multiple items in the PO. I have a
command button to Print PO but I end up with a report for each item in the
subform.

This is the SQL for the Print PO.

SELECT DISTINCT [Purchase Order Table].[PO Number], [Purchase Order
Table].[Purchase Order Date], [Purchase Order Table].[Requested By],
[Purchase Order Table].[Approved By], [Purchase Items List Query].Quantity,
[Purchase Items List Query].Description, [Purchase Items List Query].[Unit
Price], [Purchase Items List Query].Per, [Purchase Order Table].[Estimated
Cost], [Vendor Table].Company, [Vendor Table].[Street Address], [Vendor
Table].[Street Address 2], [Vendor Table].City, [Vendor Table].State, [Vendor
Table].[Zip Code], [Vendor Table].[Phone Number], [Vendor Table].[Fax Number]
FROM ([Vendor Table] INNER JOIN [Purchase Order Table] ON ([Vendor
Table].Company = [Purchase Order Table].Vendor) AND ([Vendor Table].Company =
[Purchase Order Table].Vendor)) INNER JOIN [Purchase Items List Query] ON
[Purchase Order Table].[PO Number] = [Purchase Items List Query].[PO Number];

Can anyone help me figure out what in the heck I have done wrong here? I am
pulling my hair out!

Thanks!
Cindy

On Monday, January 25, 2010 11:59 PM
Allen Browne wrote:

Your query has no WHERE clause, so you have probably tried to restrict
Your query has no WHERE clause, so you have probably tried to restrict the
report by including a WHERE clause in a lower level query such as [Purchase
Items List Query].

You may find it easier to remove the criteria from that query (perhaps even
remove the query from this SQL statement), and instead use the
WhereCondition of OpenReport to restrict it to the PO in the form. Here is an
example of how that is done:
Print the record in the form
at:
http://allenbrowne.com/casu-15.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


SELECT DISTINCT [Purchase Order Table].[PO Number],
[Purchase Order Table].[Purchase Order Date],
[Purchase Order Table].[Requested By],
[Purchase Order Table].[Approved By],
[Purchase Items List Query].Quantity,
[Purchase Items List Query].Description,
[Purchase Items List Query].[Unit Price],
[Purchase Items List Query].Per,
[Purchase Order Table].[Estimated Cost],
[Vendor Table].Company,
[Vendor Table].[Street Address],
[Vendor Table].[Street Address 2],
[Vendor Table].City,
[Vendor Table].State,
[Vendor Table].[Zip Code],
[Vendor Table].[Phone Number],
[Vendor Table].[Fax Number]
FROM ([Vendor Table] INNER JOIN [Purchase Order Table]
ON ([Vendor Table].Company = [Purchase Order Table].Vendor)
AND ([Vendor Table].Company = [Purchase Order Table].Vendor))
INNER JOIN [Purchase Items List Query]
ON [Purchase Order Table].[PO Number] = [Purchase Items List Query].[PO
Number];

On Tuesday, January 26, 2010 1:28 PM
Cindy wrote:

Allen,I have done some testing, changed to VBA code in your example (I use it
Allen,

I have done some testing, changed to VBA code in your example (I use it in
another database with perfect results) and got the same result.

What I just noticed is that each item in the subform is showing as a
separate record in the form count that is on the bottom of a form. You know,
the 1 of 8, etc. I have 5 test PO's in there and it is showing 8 records.
It is not counting or showing PO #1 which has nothing in the subform but is
counting and showing PO#2 twice which has 2 items in the subform and PO#4
three times which has 3 items in the subform.

I think my problem is not the Print PO but something I have got set up wrong
in the form/subform. Since this is my first stab at subforms I am not even
sure where to look. Any suggests?

Thanks!
Cindy

"Allen Browne" wrote:

On Tuesday, January 26, 2010 8:44 PM
Allen Browne wrote:

Does the subform use a query as its Record Source?
Does the subform use a query as its Record Source?

If so, open the query itself, and see if the records are duplicated there as
well.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

On Wednesday, January 27, 2010 8:59 PM
Cindy wrote:

Allen,Well, once again you saved the day.
Allen,

Well, once again you saved the day. The problem was I had the subform
fields in the Print PO Query as well as the subform query. Removed them from
the Print PO Query and it worked perfect.

Thanks for your help.

Cindy

"Allen Browne" wrote:


Submitted via EggHeadCafe - Software Developer Portal of Choice
SharePoint Video Library Template Available For Download
http://www.eggheadcafe.com/tutorials/aspnet/223c6e57-f81f-44b3-ab05-59...2b0ab63
 >> Stay informed about: Subform causing duplicate records? 
Back to top
Login to vote
De Jager

External


Since: Mar 13, 2010
Posts: 1



(Msg. 7) Posted: Sat Mar 13, 2010 7:33 pm
Post subject: Re: PO database [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Bry Anhuit" wrote in message
> Cindy,
> I am trying to develop a PO database in Access 2007. I am new to VBA and
> SQL, although I have some experience in Access. Everything I have ever
> found on the net is for tracking purchases of a customer, but I am trying
> to track purchases I make from my vendors.
>
> It seems you have written that type of database.
>
> Can you send me the table layout and table fields of your database? What I
> am having the most trouble with is getting the subform to work within the
> main form and it seems you have solved that. I can never seem to get the
> results I expect to get.
>
> Any help you can send in regards to creating and printing a multi-item
> order would be greatly appreciated.
>
> Thanks in advance
> Bry
>
>
>
> Cindy wrote:
>
> Allen,Well, once again you saved the day.
> 27-Jan-10
>
> Allen,
>
> Well, once again you saved the day. The problem was I had the subform
> fields in the Print PO Query as well as the subform query. Removed them
> from
> the Print PO Query and it worked perfect.
>
> Thanks for your help.
>
> Cindy
>
> "Allen Browne" wrote:
>
> Previous Posts In This Thread:
>
> On Monday, January 25, 2010 9:53 PM
> Cindy wrote:
>
> Subform causing duplicate records?
> I am trying to do a Purchase Order database. I need a subform in the PO
> Data
> Entry Form since there are usually multiple items in the PO. I have a
> command button to Print PO but I end up with a report for each item in the
> subform.
>
> This is the SQL for the Print PO.
>
> SELECT DISTINCT [Purchase Order Table].[PO Number], [Purchase Order
> Table].[Purchase Order Date], [Purchase Order Table].[Requested By],
> [Purchase Order Table].[Approved By], [Purchase Items List
> Query].Quantity,
> [Purchase Items List Query].Description, [Purchase Items List Query].[Unit
> Price], [Purchase Items List Query].Per, [Purchase Order Table].[Estimated
> Cost], [Vendor Table].Company, [Vendor Table].[Street Address], [Vendor
> Table].[Street Address 2], [Vendor Table].City, [Vendor Table].State,
> [Vendor
> Table].[Zip Code], [Vendor Table].[Phone Number], [Vendor Table].[Fax
> Number]
> FROM ([Vendor Table] INNER JOIN [Purchase Order Table] ON ([Vendor
> Table].Company = [Purchase Order Table].Vendor) AND ([Vendor
> Table].Company =
> [Purchase Order Table].Vendor)) INNER JOIN [Purchase Items List Query] ON
> [Purchase Order Table].[PO Number] = [Purchase Items List Query].[PO
> Number];
>
> Can anyone help me figure out what in the heck I have done wrong here? I
> am
> pulling my hair out!
>
> Thanks!
> Cindy
>
> On Monday, January 25, 2010 11:59 PM
> Allen Browne wrote:
>
> Your query has no WHERE clause, so you have probably tried to restrict
> Your query has no WHERE clause, so you have probably tried to restrict the
> report by including a WHERE clause in a lower level query such as
> [Purchase
> Items List Query].
>
> You may find it easier to remove the criteria from that query (perhaps
> even
> remove the query from this SQL statement), and instead use the
> WhereCondition of OpenReport to restrict it to the PO in the form. Here is
> an
> example of how that is done:
> Print the record in the form
> at:
> http://allenbrowne.com/casu-15.html
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
>
> SELECT DISTINCT [Purchase Order Table].[PO Number],
> [Purchase Order Table].[Purchase Order Date],
> [Purchase Order Table].[Requested By],
> [Purchase Order Table].[Approved By],
> [Purchase Items List Query].Quantity,
> [Purchase Items List Query].Description,
> [Purchase Items List Query].[Unit Price],
> [Purchase Items List Query].Per,
> [Purchase Order Table].[Estimated Cost],
> [Vendor Table].Company,
> [Vendor Table].[Street Address],
> [Vendor Table].[Street Address 2],
> [Vendor Table].City,
> [Vendor Table].State,
> [Vendor Table].[Zip Code],
> [Vendor Table].[Phone Number],
> [Vendor Table].[Fax Number]
> FROM ([Vendor Table] INNER JOIN [Purchase Order Table]
> ON ([Vendor Table].Company = [Purchase Order Table].Vendor)
> AND ([Vendor Table].Company = [Purchase Order Table].Vendor))
> INNER JOIN [Purchase Items List Query]
> ON [Purchase Order Table].[PO Number] = [Purchase Items List Query].[PO
> Number];
>
> On Tuesday, January 26, 2010 1:28 PM
> Cindy wrote:
>
> Allen,I have done some testing, changed to VBA code in your example (I use
> it
> Allen,
>
> I have done some testing, changed to VBA code in your example (I use it in
> another database with perfect results) and got the same result.
>
> What I just noticed is that each item in the subform is showing as a
> separate record in the form count that is on the bottom of a form. You
> know,
> the 1 of 8, etc. I have 5 test PO's in there and it is showing 8 records.
> It is not counting or showing PO #1 which has nothing in the subform but
> is
> counting and showing PO#2 twice which has 2 items in the subform and PO#4
> three times which has 3 items in the subform.
>
> I think my problem is not the Print PO but something I have got set up
> wrong
> in the form/subform. Since this is my first stab at subforms I am not
> even
> sure where to look. Any suggests?
>
> Thanks!
> Cindy
>
> "Allen Browne" wrote:
>
> On Tuesday, January 26, 2010 8:44 PM
> Allen Browne wrote:
>
> Does the subform use a query as its Record Source?
> Does the subform use a query as its Record Source?
>
> If so, open the query itself, and see if the records are duplicated there
> as
> well.
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> On Wednesday, January 27, 2010 8:59 PM
> Cindy wrote:
>
> Allen,Well, once again you saved the day.
> Allen,
>
> Well, once again you saved the day. The problem was I had the subform
> fields in the Print PO Query as well as the subform query. Removed them
> from
> the Print PO Query and it worked perfect.
>
> Thanks for your help.
>
> Cindy
>
> "Allen Browne" wrote:
>
>
> Submitted via EggHeadCafe - Software Developer Portal of Choice
> SharePoint Video Library Template Available For Download
> http://www.eggheadcafe.com/tutorials/aspnet/223c6e57-f81f-44b3-ab05-59...2b0ab63
 >> Stay informed about: Subform causing duplicate records? 
Back to top
Login to vote
joelgeraldine

External


Since: Mar 17, 2010
Posts: 1



(Msg. 8) Posted: Wed Mar 17, 2010 2:19 pm
Post subject: Re: PO database [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

rghjjjjjkkk

"Bry Anhuit" a écrit dans le message de groupe de discussion :
201039162128bryanh DeleteThis @pdq.net...
> Cindy,
> I am trying to develop a PO database in Access 2007. I am new to VBA and
> SQL, although I have some experience in Access. Everything I have ever
> found on the net is for tracking purchases of a customer, but I am trying
> to track purchases I make from my vendors.
>
> It seems you have written that type of database.
>
> Can you send me the table layout and table fields of your database? What I
> am having the most trouble with is getting the subform to work within the
> main form and it seems you have solved that. I can never seem to get the
> results I expect to get.
>
> Any help you can send in regards to creating and printing a multi-item
> order would be greatly appreciated.
>
> Thanks in advance
> Bry
>
>
>
> Cindy wrote:
>
> Allen,Well, once again you saved the day.
> 27-Jan-10
>
> Allen,
>
> Well, once again you saved the day. The problem was I had the subform
> fields in the Print PO Query as well as the subform query. Removed them
> from
> the Print PO Query and it worked perfect.
>
> Thanks for your help.
>
> Cindy
>
> "Allen Browne" wrote:
>
> Previous Posts In This Thread:
>
> On Monday, January 25, 2010 9:53 PM
> Cindy wrote:
>
> Subform causing duplicate records?
> I am trying to do a Purchase Order database. I need a subform in the PO
> Data
> Entry Form since there are usually multiple items in the PO. I have a
> command button to Print PO but I end up with a report for each item in the
> subform.
>
> This is the SQL for the Print PO.
>
> SELECT DISTINCT [Purchase Order Table].[PO Number], [Purchase Order
> Table].[Purchase Order Date], [Purchase Order Table].[Requested By],
> [Purchase Order Table].[Approved By], [Purchase Items List
> Query].Quantity,
> [Purchase Items List Query].Description, [Purchase Items List Query].[Unit
> Price], [Purchase Items List Query].Per, [Purchase Order Table].[Estimated
> Cost], [Vendor Table].Company, [Vendor Table].[Street Address], [Vendor
> Table].[Street Address 2], [Vendor Table].City, [Vendor Table].State,
> [Vendor
> Table].[Zip Code], [Vendor Table].[Phone Number], [Vendor Table].[Fax
> Number]
> FROM ([Vendor Table] INNER JOIN [Purchase Order Table] ON ([Vendor
> Table].Company = [Purchase Order Table].Vendor) AND ([Vendor
> Table].Company =
> [Purchase Order Table].Vendor)) INNER JOIN [Purchase Items List Query] ON
> [Purchase Order Table].[PO Number] = [Purchase Items List Query].[PO
> Number];
>
> Can anyone help me figure out what in the heck I have done wrong here? I
> am
> pulling my hair out!
>
> Thanks!
> Cindy
>
> On Monday, January 25, 2010 11:59 PM
> Allen Browne wrote:
>
> Your query has no WHERE clause, so you have probably tried to restrict
> Your query has no WHERE clause, so you have probably tried to restrict the
> report by including a WHERE clause in a lower level query such as
> [Purchase
> Items List Query].
>
> You may find it easier to remove the criteria from that query (perhaps
> even
> remove the query from this SQL statement), and instead use the
> WhereCondition of OpenReport to restrict it to the PO in the form. Here is
> an
> example of how that is done:
> Print the record in the form
> at:
> http://allenbrowne.com/casu-15.html
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
>
> SELECT DISTINCT [Purchase Order Table].[PO Number],
> [Purchase Order Table].[Purchase Order Date],
> [Purchase Order Table].[Requested By],
> [Purchase Order Table].[Approved By],
> [Purchase Items List Query].Quantity,
> [Purchase Items List Query].Description,
> [Purchase Items List Query].[Unit Price],
> [Purchase Items List Query].Per,
> [Purchase Order Table].[Estimated Cost],
> [Vendor Table].Company,
> [Vendor Table].[Street Address],
> [Vendor Table].[Street Address 2],
> [Vendor Table].City,
> [Vendor Table].State,
> [Vendor Table].[Zip Code],
> [Vendor Table].[Phone Number],
> [Vendor Table].[Fax Number]
> FROM ([Vendor Table] INNER JOIN [Purchase Order Table]
> ON ([Vendor Table].Company = [Purchase Order Table].Vendor)
> AND ([Vendor Table].Company = [Purchase Order Table].Vendor))
> INNER JOIN [Purchase Items List Query]
> ON [Purchase Order Table].[PO Number] = [Purchase Items List Query].[PO
> Number];
>
> On Tuesday, January 26, 2010 1:28 PM
> Cindy wrote:
>
> Allen,I have done some testing, changed to VBA code in your example (I use
> it
> Allen,
>
> I have done some testing, changed to VBA code in your example (I use it in
> another database with perfect results) and got the same result.
>
> What I just noticed is that each item in the subform is showing as a
> separate record in the form count that is on the bottom of a form. You
> know,
> the 1 of 8, etc. I have 5 test PO's in there and it is showing 8 records.
> It is not counting or showing PO #1 which has nothing in the subform but
> is
> counting and showing PO#2 twice which has 2 items in the subform and PO#4
> three times which has 3 items in the subform.
>
> I think my problem is not the Print PO but something I have got set up
> wrong
> in the form/subform. Since this is my first stab at subforms I am not
> even
> sure where to look. Any suggests?
>
> Thanks!
> Cindy
>
> "Allen Browne" wrote:
>
> On Tuesday, January 26, 2010 8:44 PM
> Allen Browne wrote:
>
> Does the subform use a query as its Record Source?
> Does the subform use a query as its Record Source?
>
> If so, open the query itself, and see if the records are duplicated there
> as
> well.
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> On Wednesday, January 27, 2010 8:59 PM
> Cindy wrote:
>
> Allen,Well, once again you saved the day.
> Allen,
>
> Well, once again you saved the day. The problem was I had the subform
> fields in the Print PO Query as well as the subform query. Removed them
> from
> the Print PO Query and it worked perfect.
>
> Thanks for your help.
>
> Cindy
>
> "Allen Browne" wrote:
>
>
> Submitted via EggHeadCafe - Software Developer Portal of Choice
> SharePoint Video Library Template Available For Download
> http://www.eggheadcafe.com/tutorials/aspnet/223c6e57-f81f-44b3-ab05-59...2b0ab63
 >> Stay informed about: Subform causing duplicate records? 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Entering records on a subform - I have read topics related to my problem but I can't seem to find a solution. I have a form that has a combo box containing events. The records for the combo box come from a query. After selecting an event, a subform is populated with staffing..

What's causing error 2465? - A user gets error 2465: "Can't find field | which is being refered to in the expression". The error is generated in the following function but the user and I can't reproduce it. The function seems to work fine. Any idea what might cause this ...

SUBFORM was working and now it's not - Hi, My subform (order details) in a purchase order has been working and now is not. I have not made any changes to either form or subform... so I'm baffled as to why it would suddenly stop working. What it is doing (or more accurately not doing): ...

Subform not allowing update - Hi, I'm sure there is a simple answer to this, but for some reason my subform isn't allowing me to add records and I'm not sure why. I've gone through this set up a few times and I have previously been able to add records. Is there a common pitfall..

records for last 6 months - What is a good way to filter a query so it only displays records for the last 6 months ? What I have now in the criteria is <=Date()-182. Is there an easier way to do this? I keep getting an error saying inconsistent datatypes. I'm pretty new to ac...
   Windows Help (Home) -> Microsoft Access All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]