Tab Control Record Source?

misterpox

New Member
Joined
Jan 7, 2003
Messages
26
Using Access 2000, OS = Win2Kpro

I have a form which, in the top 3/4 portion, has several textbox controls linked to a table (table 1) to display the records from that table, based on search criteria a user inputs prior to the form loading.

On the bottom of the form I've placed a Tab Control with 2 tabs. Within each tab, there are textbox controls which I want to display the records from a different table (table 2). I want the recordset for the controls on the tabs to populate based on using the value from a control on the upper portion of the form to select records from table 2 that match that field value.

Is this possible? And if so, I can't figure out how to create the recordset for the controls within the Tab Control to use. Can anyone help?
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Why not try a subform?

It could have the tab control and be linked to the main from via a common field in table 1 and table 2.
 
Upvote 0
That was the ticket Norie, thx for your reply.

I put subforms in each tab of the tab control and can do everything I need from it now.
 
Upvote 0
Norie, (or anyone)

I've got this tab control working in my form now. The tab control has 2 tabs, each containing a single subform.

When my main form is opened, I have an On Open event that sets the visibility of one of the form's command buttons to False as follows which works;
------------------------------------
With Me!cmd_mybuttonname
.Visible = Not .Visible
End With
------------------------------------
I'm trying to create an event that sets this button back to visible when a user clicks on the second tab of the tab control. Where the heck do I set that?

I've tried event procedures with the following code in On Click event of tab 2 in the tab control (which is where I would like it to happen, but it doesn't), the On Load, On Open, On Activate, On Got Focus of the subform in tab 2, but none of them make the command button visible.
------------------------------------
Forms!MainForm.Controls!cmd_mybuttonname.Visible = True 'doesn't work
Forms!MainForm!cmd_mybuttonname.Visible = True 'doesn't work
------------------------------------

Am I just not using the right event to make the button visible again??

Also, I cannot get the subform in tab 2 of the tab control to allow edits and user entry into the fields without setting the main form to allow this also. Is there a way to set the subform in a tab of a tab control to allow edits and entry into controls independently of the settings in the main form?

thx again.
 
Upvote 0

Forum statistics

Threads
1,221,814
Messages
6,162,135
Members
451,743
Latest member
matt3388

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top