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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tab Control Problem 1

Status
Not open for further replies.

tlaksh

Programmer
Feb 25, 2001
98
US
I have created a unbound form for parameter queries which uses a tab control with two tab pages.

Tab page1 has a list item that has the names of the queries and two command buttons. When a user selects a value in the list(i.e.the name of the query) and clicks on ok, I need for tabpage2 to appear with respective controls like textbox, listitem etc....

The items in tabpage2 will change (visible / invisible) based on the parameters of the query selected in tabpage1.

Can this be done programatically. I am new to Access 97 and so can someone please help. Thank u in advance.

 
Something like
form1!tabpage2.SetFocus
in the button_click sub should do the focus OK (from memory).

Could hide/show indididual controls or hide/show whole subforms on tabpage2.

Is this just dealing with a set amount of queries with vastly different inputs which won't change,
or with many queries which could be added to but with generally the same input param requirements (eg Month, Year, StartDate, EndDate)?


Ben
+61 403 395 052
 
Set page2's Visible property to False in Design View. In the Click event for the OK button, set the page 2 controls visible/invisible in response to the list box choice, then make page2 visible and call its SetFocus method to bring it to the front.

What's not clear is how you plan to use the query. Is it supposed to be the record source for the controls on page 2? That won't work; all the controls on a form share the same record source. However, as Ben mentioned, you can use a subform control on page 2. You'll have to set up a separate form to use as a subform for each query (or at least for each group of queries with the same fields, if some of them have the same fields). Then, when the OK button is clicked, you can change the subform control's SourceObject property to the value selected in the list box. Rick Sprague
 
Thanks for the input guys. To answer ur questions, first of all the list is a static list. It has a set amount of queries. Some of these queries have the same parameters like from date and to date. Some have from date and to date but also an additional parameter like company name , state etc....

I would ideally like to pass the name of the query from tab1 to display the parameter controls on tab2 and also on the button on page2 that will actually run the query. I hope i have made my problem clear now...Any suggestions ???

Thanks for all the help once again.

Laksh.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top