Long split table

Alright... turns out that I can add all my subforms in a tab control. Here's an attached DB (in 2003) format. Look at "form1"

My only question now is: If you take a look at bottom of each subform, there is a button which opens the form (in its own window). Is there a way by which I can make this button focus on the next tab in the existing form?

If this is possible, I can manage the rest. I really appreciate all your help esp Uncle Gizmo. I know that this DB is not structured correctly but this is all I have right now. Will probably take some classes next summer for database design. :)

P.S. - As you can see in the DB, I added an ID section on each form in case no solution comes up. I'll probably have the study participants enter it manually on each screen.
 

Attachments

Is there a way by which I can make this button focus on the next tab in the existing form?


Me.tabcontrolname.Pages(x).SetFocus

(Where x is the index starting at zero for the first tab.)
 
As you can see in the DB, I added an ID section on each form in case no solution comes up. I'll probably have the study participants enter it manually on each screen.


I have not looked at the db but it sounds like you just need to set the MasterLinkFields and ChildLinkFields for the subformcontrols to the ID fields.
 
@ UncleGizmo

thank you for all your little tutorial videos. Everything seems to be working fine (in terms of linking the tables). I was actually able to cut down the number of tables to just 3.

Just one last issue

I've numbered all the pages on the tab control as 1,2,3, etc

Now when someone clicks on the button at the end of subform, I get an error in VBA code. It appears that for some reason, access is unable to set focus on the next tab on the main form. Maybe I'm doing something wrong.

I used the following code:

Code:
    Me!tabctrl.Pages(1).SetFocus

Am attaching a copy of the DB with this post.
 

Attachments

You have the next button in a subform on the tab.

The reference to tabctrl should be via the Parent form:
Me.Parent.Form.tabctrl.Pages(x).SetFocus

A variation is to have the Next button located on the main form below the tab control. Code is used to detect the current page with the On Change Event of the tab control and then increment the index for the command to move to the next. Saves a lot of code compared to one button on each form.

The index for the current page is the Value property of the tab control.

If you wish the Caption of the button can be changed with the On Change Event of the tab control.

I would include a Back button too. The Back button should be disabled for the first page and the Next button disabled for the last page.
 

Users who are viewing this thread

Back
Top Bottom