I am trying to change the Data Entry, Addition, Deletion and Edit settings of a form (frm_aaa_TabbedPagesPractice) programmatically. This form has a Tab Control with the following four tab pages:
Page Name Page Index
Add/Main 0
Edit/Delete 1
Reports/Charts 2
Tables 3
The form opens OK from design view to form view on any of the pages, but when I click on one of the tabs in form view, I get the message that the “Object does not support this property or method.” Following is the code I am currently trying to use. I know I will need to set my “Allows…” to either true or false depending on my requirements, but I am not yet able to get the code to work to see how I want to set them.
If there is a better/easier way to do this or if I am way off base, please let me know. Any help will be appreciated.
Thanks.
Page Name Page Index
Add/Main 0
Edit/Delete 1
Reports/Charts 2
Tables 3
The form opens OK from design view to form view on any of the pages, but when I click on one of the tabs in form view, I get the message that the “Object does not support this property or method.” Following is the code I am currently trying to use. I know I will need to set my “Allows…” to either true or false depending on my requirements, but I am not yet able to get the code to work to see how I want to set them.
Code:
Private Sub tab_Pages_Change()
Dim frm As Form
'With frm
If Forms("frm_aaa_TabbedPagesPractice").Controls("tab_Pages").PageIndex = 0 Then
With frm
.AllowDataEntry = False
.AllowAdditions = False
.AllowDeletions = False
.AllowEdits = False
End With
ElseIf Forms("frm_aaa_TabbedPagesPractice").Controls("tab_Pages").PageIndex = 1 Then
With frm
.AllowDataEntry = False
.AllowAdditions = False
.AllowDeletions = False
.AllowEdits = False
End With
ElseIf Forms("frm_aaa_TabbedPagesPractice").Controls("tab_Pages").PageIndex = 2 Then
With frm
.AllowDataEntry = False
.AllowAdditions = False
.AllowDeletions = False
.AllowEdits = False
End With
ElseIf Forms("frm_aaa_TabbedPagesPractice").Controls("tab_Pages").PageIndex = 3 Then
With frm
.AllowDataEntry = False
.AllowAdditions = False
.AllowDeletions = False
.AllowEdits = False
End With
End If
'End With
End Sub
If there is a better/easier way to do this or if I am way off base, please let me know. Any help will be appreciated.
Thanks.