D
David via AccessMonster.com
I have a multi-page form setup in Single Form view with Command Buttons to
move from page to page (like a tab control without the actual tab control).
I also have my own Navigation Buttons to move from record to record (First,
Previous, Next, Last, New). The code behind the nav buttons uses sytax like
'DoCmd.GoToRecord , , acFirst'.
The command buttons for the tabs/pages and the nav buttons for the records
all work well. The question here is why focus jumps to the first control on
the first page when I move to either the first or last record? For
example...
If I am on Record 2 of 5, and I click the command button to view Page 2,
then the focus is on the first control on Page 2. If I click cmdNext, I go
to Record 3 of 5 and stay on Page 2. But if I click cmdPrevious instead, I
go to Record 1 of 5 and jump to the first control on Page 1. I only jump
off of Page 2 if my destination record is the first or last record of the
set. If I go between records 2 and 4, no problem. Also, no problem if I use
Access's standard nav buttons.
So, why does DoCmd.GoToRecord make the focus jump pages/controls when I
land on the first or last record?
(Also, how to prevent it?)
*If the answer isn't obvious to anyone, I will post sample DB.
Thanks,
David
move from page to page (like a tab control without the actual tab control).
I also have my own Navigation Buttons to move from record to record (First,
Previous, Next, Last, New). The code behind the nav buttons uses sytax like
'DoCmd.GoToRecord , , acFirst'.
The command buttons for the tabs/pages and the nav buttons for the records
all work well. The question here is why focus jumps to the first control on
the first page when I move to either the first or last record? For
example...
If I am on Record 2 of 5, and I click the command button to view Page 2,
then the focus is on the first control on Page 2. If I click cmdNext, I go
to Record 3 of 5 and stay on Page 2. But if I click cmdPrevious instead, I
go to Record 1 of 5 and jump to the first control on Page 1. I only jump
off of Page 2 if my destination record is the first or last record of the
set. If I go between records 2 and 4, no problem. Also, no problem if I use
Access's standard nav buttons.
So, why does DoCmd.GoToRecord make the focus jump pages/controls when I
land on the first or last record?
(Also, how to prevent it?)
*If the answer isn't obvious to anyone, I will post sample DB.
Thanks,
David