Form openning too many times

E

Emma

I'm having a problem with my form. Instead of showing just one subform it's
showing the # of Amount of Payments. For example if I enter 3 Amount of
Payments then the main form opens 3 times with the same data everytime. I
would only like it to open once. Here's my code:
SELECT [OLF Table].*, [OLF - Payment History].PaymentDue, [OLF - Payment
History].AmountOfPayment AS [AmountOfPayment_OLF - Payment History]FROM [OLF
Table] INNER JOIN [OLF - Payment History] ON [OLF Table].ID = [OLF - Payment
History].[LoanPayment ID];
Thanks Emma
 
J

John W. Vinson

I'm having a problem with my form. Instead of showing just one subform it's
showing the # of Amount of Payments. For example if I enter 3 Amount of
Payments then the main form opens 3 times with the same data everytime. I
would only like it to open once. Here's my code:
SELECT [OLF Table].*, [OLF - Payment History].PaymentDue, [OLF - Payment
History].AmountOfPayment AS [AmountOfPayment_OLF - Payment History]FROM [OLF
Table] INNER JOIN [OLF - Payment History] ON [OLF Table].ID = [OLF - Payment
History].[LoanPayment ID];
Thanks Emma

Well, it's showing you exactly what you're asking it to show you: each record
in [OLF Table] joined to every matching record in [OLF - Payment History].

Perhaps you should consider using a Form based on OLF Table, with a Subform
based on [OLF - Payment History], using ID as the master link field and
LoanPayment ID as the Child Link Field. Display the OLF Table fields on the
mainform and the payment history fields on the subform.
 
E

Emma

That's what I thought I was doing? Do I just delete the code?

John W. Vinson said:
I'm having a problem with my form. Instead of showing just one subform it's
showing the # of Amount of Payments. For example if I enter 3 Amount of
Payments then the main form opens 3 times with the same data everytime. I
would only like it to open once. Here's my code:
SELECT [OLF Table].*, [OLF - Payment History].PaymentDue, [OLF - Payment
History].AmountOfPayment AS [AmountOfPayment_OLF - Payment History]FROM [OLF
Table] INNER JOIN [OLF - Payment History] ON [OLF Table].ID = [OLF - Payment
History].[LoanPayment ID];
Thanks Emma

Well, it's showing you exactly what you're asking it to show you: each record
in [OLF Table] joined to every matching record in [OLF - Payment History].

Perhaps you should consider using a Form based on OLF Table, with a Subform
based on [OLF - Payment History], using ID as the master link field and
LoanPayment ID as the Child Link Field. Display the OLF Table fields on the
mainform and the payment history fields on the subform.
 
E

Emma

I got rid of the inner join and it seems to be working fine now, Thanks

John W. Vinson said:
I'm having a problem with my form. Instead of showing just one subform it's
showing the # of Amount of Payments. For example if I enter 3 Amount of
Payments then the main form opens 3 times with the same data everytime. I
would only like it to open once. Here's my code:
SELECT [OLF Table].*, [OLF - Payment History].PaymentDue, [OLF - Payment
History].AmountOfPayment AS [AmountOfPayment_OLF - Payment History]FROM [OLF
Table] INNER JOIN [OLF - Payment History] ON [OLF Table].ID = [OLF - Payment
History].[LoanPayment ID];
Thanks Emma

Well, it's showing you exactly what you're asking it to show you: each record
in [OLF Table] joined to every matching record in [OLF - Payment History].

Perhaps you should consider using a Form based on OLF Table, with a Subform
based on [OLF - Payment History], using ID as the master link field and
LoanPayment ID as the Child Link Field. Display the OLF Table fields on the
mainform and the payment history fields on the subform.
 
J

John W. Vinson

I got rid of the inner join and it seems to be working fine now, Thanks

I hope you got rid of the second table in the query! The problem is that you
had some form (it's not clear from your post whether it was the mainform or
subform) based on this two-table joined query.

The mainform should be based on the parent table - only.
The subform should be based on the child table - only.
No join (inner, outer, or Cartesian e.g. no join at all) is needed in this
case.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top