Topics Search

Reference to Tab Control in VBA (Should be easy)

Reference to Tab Control in VBA (Should be easy)
Views: 12
I'm trying to disable all textboxes and comboboxes for people whose access is not "Admin". For some reason this also disables my Tab Control and I can't figure out how to make it so that non-admins can still look at the different tabs

This is my code (I don't know how to post it fancy)

Private Sub Form_Load()
Dim rs As dao.Recordset
Dim permission As String
Dim ctlTmp As Control
Set rs = CurrentDb.OpenRecordset("Select * FROM qry_UserGroup")
permission = rs!UserPermissions
If permission = "Admin" Then
Forms("frm_EmployeeInformation").AllowEdits = True
Else
Forms("frm_EmployeeInformation").AllowEdits = False
On Error Resume Next
For Each ctlTmp In Forms("frm_EmployeeInformation").Controls
If TypeOf ctlTmp Is ComboBox Or TypeOf ctlTmp Is TextBox Then
ctlTmp.Enabled = False
End If
Next ctlTmp
End If
rs.Close
Set rs = Nothing
Sponsored Links:

More topics

 

Set Focus to specific tab on a Tab Control

Preview
Is it possible to set the focus on a specific tab on a tab control via VBA? My goal is to set the focus to the tab when the form opens.

Different iterations of Me.TabCtl0.Pages.Page1.SetFocus doesn't work. I am unable to find the correct syntax to reference the tab.
 

Reference to Tab Control in VBA

Preview
I'm trying to disable textboxes and comboboxes for people whose access is not "Admin". For some reason this also disables my Tab Control and I can't figure out how to make it so that non-admins can still look at the different tabs...
 

Reference a field on a tab control

Preview
I am having trouble with a tab control. I am trying to reference a text field on a subform of a tab control using a query.

Main Form: frmSwitchBoard
Tab Control: TabCtl0
Sheet Name: SearchClaims
SubForm: frmClaimSearch
Text Field: Text54

I am trying to reference that field in a query, but I am trying a hard time getting it to find the field.

This is what I have so far:

[Forms]![frmSwitchBoard]![TabCtl0]![frmClaimSearch].[text54]

I tried going through other post and looked at the following link, http://access.mvps.org/access/forms/frm0031.htm, but wasn't able to figure it out
 

Refer to Control within a Tab Control in VBA #2

Preview
I would like to add a reply to thread 27700 but when I go to it, I am logged out

I have a Tab Control on my form and have recently copy-pasted my controls on to it - however my VBA no longer works. From what I've read, each control (regardless of which tab its on) needs a unique name - check, and therefore can be referred to as if it were directly on the form and there was no Tab control.

txtDOB is the text field to store - you guessed it, a Date Of Birth.
lblAGE is a label to show "30 years, 3 months" etc, which is done by VBA within OnCurrent so it refreshes automatically as you move from person to person.

Now a simple bit of code like. lblAge.Caption = "test" creates runtime error 424; Object required.

It works directly on the form outside the realms of the Tab, but not on a Tab.

Form is called frmMembers
Tab Control called TabCtl1
Page Name called Page1
 

Access 2010 - Navigation Forms (how to reference a control)

Preview
I love the new navigation form functionality in Access 2010, however am having problems referencing a control within the subforms.

I have 10 navigation buttons on the parent form, each with a subform. I desparately need to be able to reference controls within each subform, however am struggling with the syntax.

I have tried the following code:
[Forms]![frmParentform]![frmNavigationsubform].[form].[cboControl]
which works beautifully for the first subform (ie. Tab Index = 0)

However, I am stumped as how to reference a control on any of the other 9 subforms (ie Tab Index - 1-8) as the aforementioned syntax doesn't work for any of them but the first (ie Tab Index
 

Catching Tab Control Page Changes with VBA

Preview
I currently have a form which contains a tab control (which has six different pages). I am trying to find out how I can catch a page change on the tab control in order to trigger certain
 

Refer to Tab Control Objects in VBA

Preview
You can use a tab control to present several pages of information about a single form. A tab control is useful when your form contains information that can be sorted into two or more categories. Learn how to use tab controls on a form.
 

Scrolling a tab page

Preview
Is it possible to have scrolling capability within a tab page on a form?

Currently I have a form with tab control. There are 7 tabs and the 7th tab has a long list of check boxes that wont fit inside the area I set aside for the tab control box. When I place the check boxes into the tab page, the page automatically re-sizes to contain all the new check-boxes. I am not able to re-size the tab page. Are there any settings that will allow me to re-size the tab page to contain all the check-boxes and scroll to view them all?

It seems like it should be easy and straightforward. right?
 

Access control in 2nd level subform using tab control

Preview
I tried a few google hits in regards to this but it doesn't seem to be working. I have 3 forms (frminstution -> invoice -> frminvoicelinedetail (this subform is on a tab control called pgShipping)).

I am trying to reference an object (called OrderLink) on the InvoiceLineDetail in a query.

These were attempts at trying to go about it. All I get is a parameter box, which there should be none (the forum is open so it isn't that
 

How to reference a control on a subform in a tab

Preview
I have a Mainform called Mainfrm and on it is a tab called Tabctl1.

On this tab is a page called pg1 and on the tab is a subform called form2.

This form2 has a control I'd like to make enabled when a button is pressed from MainForm.

I've been trying to use