Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Looking for information on Tab Control 1

Status
Not open for further replies.

b31luv

Technical User
Feb 21, 2002
171
US
I have a form that I designed using a Tab Control. All of the forms work the way I need I just that the tab control would make it easier for the client when moving from form to form. The problem I'm noticing, might not be a problem it could be just my knowledge base, when you move from one tab to the next the information is not updating. Case in point. First form the user selects the site where he/she is working after they select the site the detail section shows all areas at that site. The user must then select the area. Once this is done the user can move on to selecting the equipment my clicking a control button. This opens a new form where they can add a new piece of equipment or updated existing equipment information. All of this works really good.

Is there a way to get Tab Control to behave in this manner. Right now it opens the equipment form and shows all of the records. I inputted code and still have the same problem. It won't even display a msgbox I added to verify that it is running the cde.

I've researched other web pages on Access Tab Control and they only tell me how to set it up. I need a little more information.

Thanks
 
If you are running forms on the tab control, then you can requery the data to match only the record that you are currently working with.
 
How many tabs do you have? Are you using subforms?
Also could just describ the relationship between the datasources(tables) you are using?
Bensta
 
Right now I have two (2) tabs. Tab 1 is is for site info; Name of Site and Area Selection. Tab 2 is for equipment; Select which piece of equipment in that area.

There is a tbSiteInfo which has Site Name, Site Address, Type of Site, SiteIDNo (Primary Key), and Contact Information. Then there is the tbArea which has SiteIDNo, Area, AreaID. These two tables are used in fmSiteInfo and subArea for selection of site and area. The relationship here is one-to-many.

Next table is tbEquipment. It has a one-to-many relationship with tbArea; SiteIDNo-AreaID. tbEquipment has SiteIDNo, AreaID, tag number, Serialized Key, and Equipment Catagory.

First the client chooses the Site from the main form then the area in the subform. I inserted this into Tab 1 by selecting subform from the toolbar. I followed the same procedure for Tab 2 and inserted frmEquipment.

The way the forms work without Tab Control is as stated previously. I set up a control button on the first form that uses the stLinkCriteria and opens the second form based on the information selected on the first form.

I don't think requery will work here. I added a msgbox to the OnClick event of Tab 2 and when I click on Tab 2 of the Tab Control the msgbox does not appear, unless I wrote my requery wrong or placed it int the wrong area.

I also tried to close the inserted form on Tab 2 and reopen. However, I can't close the form. I tried to open a new form, and this ain't happening either.

I'm assuming that when using Tab Control all forms and subforms in a Tab is already open so the Tab shows what is already there and not based on information selected thru the first tab. Is it possible to use a Tab Control for what I want?

 
OnClick event of Tab 2
I'd play with the Change event procedure of the TabControl object.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I used the Change event of the TabControl now I'm getting action. I revised some of the code so that controls would be recognized. However, now it doesn't recognize the subform of the form. This is how it is written

Me![subSiteArea]!Area

Is there another way of writing this?
 
Perhaps this ?
Me![subSiteArea].Form!Area

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hey PHV. Good looking out. I had some other issues with this. One I needed a check to verify if a certain condition existed.

I used: If Me.TabCtl0.Value = 1 Then.

Then I need to give focus back to the first page so I used: Me.TabCtl0.Value = 0.

All is well. I also got rid of subforms on forms inside a tabcontrol. I started looking at using the tab control as the subform. By doing this I am able to use the same calling convention I used when not using a tabcontrol to grab information I need.

Next step. This is the question that maybe I'm not asking properly and I haven't received an answer for yet.

When I transition from page one to page two I only want equipment from the site and area that was selected on page one; however, all of the records are shown. I'm using the same stLinkCriteria I used when there was no tabcontrol. Am I missing something here? The requery of the tabcontrol or form didn't work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top