Including a sub-form in a form triples the number of records - why?

akedm

New member
Local time
, 18:25
Joined
Nov 7, 2009
Messages
8
Hi,

Noob here.

I have a form. I want that form to go to the next/previous customer when I press the next or previous button. However, when I add sub-forms, I advance to the next/previous sub-form record, not the next/previous customer.

I'm figuring out Forms. And today in form design I found out how to use sub-forms in that form. Great! Now I can see a customer and all the orders that customer has placed; that is, if I can figure it out. And it's not working out like I expected. As explained above, I know what's happening - I dont know why nor how to stop it.

So, before I add the subform, Access allows me to look through each record (each record is a customer) and I have 548 records; that is, 548 customers. Clicking on right-arrow goes to the next record; that is, the next customer. Here's what I'm talking about:

Access Record Count Question 1.png


So, I add subforms for the order history. But now I have 1663 records. I know why - there's 1663 orders. Some customers have 1, 2 or more orders. So clicking on the right-arrow goes to the next record; that is THE NEXT ORDER but same customer when that customer has more than 1 order. Here's what I'm talking about:

Access Record Count Question 2.png


Is this behavior correct? Am I expecting the wrong thing from this screen. Is this not the actual 'form' the user will see? How do I make sure that for the user the right-clock button actually advances to the next CUSTOMER, not the next ORDER.

I dont know what terms I'm looking for, so I dont know what to search for to find the answer myself.

Thanks.
 
However, when I add sub-forms, I advance to the next/previous sub-form record, not the next/previous customer.
The query for the main form includes a join to another table. Change the Recordsource of the main form to only select records from a single table.
 
Firstly, you have to use the correct navigation bar.
Secondly, you need to link master and subform, so that you only see orders for a particular customer, not all of them at once.
 
What are the types of relationships between the tables in your database? Could you please attach a picture of the relationships. So that experts can answer your question. Your question is somewhat unclear.
 
Relationships are not going to matter much, if they are not implemented in the form/subform control correctly.
 
I assume you are trying to show customer and order details on one form. That's not going to work. You must show a customer's details on a main form and the orders on a subform.
 
Why don't you all let the OP look at his main form query first?
 
Thank you all! :)

I'm at work right now, and just checked on this for a minute while working on another thing. I'll reply in a few hours with what I can.

Thank you again for all your direction.
 

Users who are viewing this thread

Back
Top Bottom