Find record on form opening

User avatar
Peter Kinross
5StarLounger
Posts: 962
Joined: 09 Feb 2010, 00:33
Location: Patterson Lakes, Victoria, Australia

Find record on form opening

Post by Peter Kinross »

I am trying to go to a record in subform D based on a record in another subform C. (both are inside the same subform B inside the main form A). I have them linked, and the linking works well except for when the forms opens. It used to work correctly and has for many years, but I must have done something, because now, the linking still works, but not on opening.
To overcome this I am trying to go to the record programatically on opening the main form. I have tried the OnLoad and OnOpen events, but the records aren't loaded then, so DoCmd.FindRecord doesn't work. The record to go to varies depending on where the main form is called from.
I'm guessing that there is a very simple way of doing this, but I just can't think of it.
Any ideas?
Avagr8day, regards, Peter

User avatar
HansV
Administrator
Posts: 78489
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Find record on form opening

Post by HansV »

The way records are loaded in subforms when a form is opened is complicated; this makes it difficult to controlo it through code. I'd try to get the linking working again - perhaps you could remove and recreate the links, or go back to a version that worked correctly.

Otherwise, I'm afraid that you will have to provide much more detailed information, and preferably a stripped down, compacted and zipped copy of the database.
Best wishes,
Hans