Subform records sequencing

G

Guest

I have a form with a subform. The 2 link child and master fields are set up
correctly. One row of the datasource my form, let's call it A, has 2
corresponding rows on the datasource on my subform. The second row of the
form datasource (call it B) has only 1 row of sub data. If I am editing the
first sub record of A and change the main form to go to B, the subform
appropriately displays the data. However, if I am editing the second sub
record of A and then change the main form to go to B, it is displaying the
empty second record, not the first one. How can I get it to display the
first record every time I change the form link data?
 
M

Marshall Barton

Helen R said:
I have a form with a subform. The 2 link child and master fields are set up
correctly. One row of the datasource my form, let's call it A, has 2
corresponding rows on the datasource on my subform. The second row of the
form datasource (call it B) has only 1 row of sub data. If I am editing the
first sub record of A and change the main form to go to B, the subform
appropriately displays the data. However, if I am editing the second sub
record of A and then change the main form to go to B, it is displaying the
empty second record, not the first one. How can I get it to display the
first record every time I change the form link data?


That seems a little odd, but I am not in a position to set
up similar forms and try to reproduce it.

Try using the main form's Current event to reposition the
subform's current record:

Me.subform.Form.Recordset.MoveFirst
 
G

Guest

Thanks. I did the moveFirst from the main form right after resetting the link
data and that did the trick
 

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