Navigation Forms - moving between tabs (1 Viewer)

cj1997

Registered User.
Local time
Yesterday, 17:31
Joined
Aug 20, 2013
Messages
13
Hi
Want to preface by saying I'm brand new to Access. Have NO experience with codes. I apologize in advance if that makes it difficult to explain!

I have set up my main data entry form as a navigation form with 5 tabs/pages. The first three all contain fields from my main data table, the other 2 tabs/pages have fields from related tables.

Ok, so my question is: is if there is a way to go from tab/page 1 through the other 4 in succession with the main primary key (in this case an object ID number) automatically populated through. As it is now, when I start a new record for an object on tab/page 1, and then go to the next tab/page, it registers a new record has been created (at the bottom of the form it updates the total amount of records entered), but I have to manually enter in the ID field at the top the object ID number that I am entering info for. Otherwise it is still showing the details associated with the last record I was in the form updating.

Hopefully there is a button/event code or something that can help me here!

I hope that made sense! please let me know if you need further explanation.

Thanks as always for your time and help!!
 

Cronk

Registered User.
Local time
Today, 10:31
Joined
Jul 4, 2013
Messages
2,772
I presume the record source you have for the form containing the tab control is bound to a query which joins the main table with your related tables.

Instead of doing this, bind your form to the main table and use subforms for the related tables on those particular tab pages.
 

cj1997

Registered User.
Local time
Yesterday, 17:31
Joined
Aug 20, 2013
Messages
13
Instead of doing this, bind your form to the main table and use subforms for the related tables on those particular tab pages.

I am not clear what you mean here? My first 3 forms contain fields all taken from the main table. Does "bind"ing them include a separate action (beyond just containing fields taken from that table)?

The remainder of my related tables are included as subforms, but I was unsure of what to do with the three forms that split up the fields from the main table.

Thanks!!
 

cj1997

Registered User.
Local time
Yesterday, 17:31
Joined
Aug 20, 2013
Messages
13
So after reading around, I am wondering if this post would apply:

Re: Access 2010 "Navigation Form" VBA code to Click a tab

...perhaps I can scrap the embedded macro and put an On Click event in for the button instead. The syntax might be simpler. After some Googling I think its probably

Private Sub btnGo_Click()
DoCmd.BrowseTo ObjectType:=acBrowseToForm, _
ObjectName:="frmBrowseTestators", _
PathToSubformControl:="frmNavigation.NavigationSubform", _
WhereCondition:="ID = " & txtTID, _
Page:="", _
DataMode:=acReadOnly
End Sub


Does this look like the right kind of code?? It is currently all jibberish to me, but I am trying to parse it all out...
 

Cronk

Registered User.
Local time
Today, 10:31
Joined
Jul 4, 2013
Messages
2,772
Now I'm not sure what you have.

Your original post referred to having tabs, with the first pages showing fields from the main table and other tabs showing fields from related tables.

Now you talk about having "my first 3 forms" or do you mean first 3 tab pages or do they multiple sub forms based on the same main table?

In any case, you need to set the Link Master/Child properties in the sub form control to the common field ie MasterTableID

This will ensure that only records in the related table which have the same index value as the record in the Master table are displayed. It will also populate the appropriate ID field in the related tables when you add a record.

You don't need VBA; the functionality is built into Access.

You may need to post a copy of your database with the form/sub forms.

BTW
 

cj1997

Registered User.
Local time
Yesterday, 17:31
Joined
Aug 20, 2013
Messages
13
Hi. Thanks for your reply!

Sorry for being sloppy with terms! Ok. So I am using the Access 2010 Navigation Form. This then embeds the forms I believe as subforms in a window, navigating to each when you press the navigation button. I have zipped and attached the database below. The main navigation form is "MasterEntry". The first three tabs link to forms created based on data fields from the main database table. Basically I want to set it up so that, as I create a new record, I can navigate through each of the five, with the record I am entering data for coming up on each new page. I do still however want to be able to click on a different form and choose which record I want to update (so I don't want it to set to only allow me to view a record selected while on the first page of the Form).

Hopefully that makes sense. I was thinking that maybe this should be done in the "Navigation Where Clause" setting, perhaps on the navigation button for each different tab/form?

Thank you very much!!

Main Navigation Form: "MasterEntry"
Forms/tabs 1-3 draw from "ID" table.
 

Attachments

  • Database Copy.zip
    163.7 KB · Views: 138

Cronk

Registered User.
Local time
Today, 10:31
Joined
Jul 4, 2013
Messages
2,772
I can't help you with Access 2010 functionality. I work with the latest version that my clients use and that currently is Access 2007.
 

Users who are viewing this thread

Top Bottom