• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1057
  • Last Modified:

Run-Time Error 2101 - Invalid Settings

I am getting the following error each time I click on any of the page tab of the Tab Control of my main form. Any suggestion as to how to correct this?

Run-Time Error '2101': - "The settings you entered is not valid for this property

and debug highlights the line below...
If Me.Dirty Then Me.Dirty = False        

from this code....

Private Sub MyTabControl_Change()
If Me.Dirty Then Me.Dirty = False                 '<<---- Error Line
' ..............................
' .............................
' .............................
       End If
End Sub
0
billcute
Asked:
billcute
  • 6
  • 3
  • 2
  • +3
1 Solution
 
Jai STech ArchCommented:
check whether Me.Dirty  is of boolean(bit) type
then try setting it like this
Me.Dirty = 0 '(for false)
0
 
billcuteAuthor Commented:
I have this public declaration in the form.

Public blnDirty As Boolean

I tried what you suggested but the error problem still exist after trial.
0
 
Jai STech ArchCommented:
it has to be blnDirty and not Dirty...
this will be the write syntax if you variable name is blnDirty...
If Me.blnDirty Then Me.blnDirty = False
0
Free recovery tool for Microsoft Active Directory

Veeam Explorer for Microsoft Active Directory provides fast and reliable object-level recovery for Active Directory from a single-pass, agentless backup or storage snapshot — without the need to restore an entire virtual machine or use third-party tools.

 
billcuteAuthor Commented:
I tried your last suggestion...and I am getting another error...

compile error:
"method or data member not found"

and debug highlighlighted...
blnDirty

Let me throw more light into my form's design that I am experimenting...

In my form I have two check fields..
chkDirty and chkNice

chkNice is for form error message while the other is for detecting form editing

Here is the code for form error if this would help find the solution:

Private Sub Form_Error(DataErr As Integer, Response As Integer)
   'Testing to knock off this Error Handling
    If Not Me.chkNice Then
        Exit Sub
    End If    
    'If we've got a closing form error ignore it - it's because of an immediately prior Update cancelation.
    If DataErr = 2169 Then
        Response = acDataErrContinue
    End If
End Sub
0
 
Patrick MatthewsCommented:
Hello billcute,

Please post the sub in its entirety, and confirm that this is in a Form module.

Regards,

Patrick
0
 
billcuteAuthor Commented:
This is the entire Sub plus the checkbox "chkDirty" design in the form.
....and the form's control source is..
=[Forms]("frmMain").[Dirty]
' **********
Private Sub MyTabControl_Change()
If Me.Dirty Then Me.Dirty = False                
       End If
End Sub
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
First ...

I'm not seeing what you need this for

Public blnDirty As Boolean  ?

And this would never work:

If Me.blnDirty  

because blnDirty is not a property of the form, but instead a Public variable

Finally ... all you really need is:

Me.Dirty = False

You don't need to test if it's True first.

But, there is nothing inherently wrong with

If Me.Dirty Then Me.Dirty = False        ' should not be give error 2101 - assuming this IS in a Form module.

Also:
jaiganeshsrinivasan:
check whether Me.Dirty  is of boolean(bit) type

mx


Dirty is a Boolean data type.


0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
More:

Not sure about that syntax ??
=[Forms]("frmMain").[Dirty]


' **********
Private Sub MyTabControl_Change()
If Me.Dirty Then Me.Dirty = False                
       End If                                              '** Get rid of this End If
End Sub

mx
0
 
billcuteAuthor Commented:
mx,
Still the error persist.
The "End If is for something else...

Thanks
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
ok ... can you post the entire code ... and note the line where this error occurs .

mx
0
 
harfangCommented:
Just making sure... You can use Me.Dirty only on forms that have a Record Source. If your form is unbound, then you would get that error...
(°v°)
0
 
billcuteAuthor Commented:
Form is bounded to a table.
0
 
puppydogbuddyCommented:
Hi Bill,
If my memory serves me correctly, you previously implemented the following articles from microsoft.  I wonder if the code you implemented for this is creating the conflict you are experiencing now with Me.Dirty?  test by commenting out the code related to the articles below, and see if your code above now works.

http://support.microsoft.com/kb/122294/EN-US/
http://support.microsoft.com/kb/210326
0
 
billcuteAuthor Commented:
To All experts,
Please accept my sincere gratitude for assisting. PDB's links resolved the problem.

Regards
Bill
0
 
puppydogbuddyCommented:
Thanks Bill.  Glad I was able to help.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 6
  • 3
  • 2
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now