Hi all,
So I make in this one particular form, I made a new event on current that runs a simple code. But everytime I opened the form or change record, this error message pops up and doesn't run the code.
This is the code that I used:
Code:
Private Sub Form_Current() If ((Me.DateBox1.value <> Null) And (Me.DateBox2.value <> Null)) Then
DateBox2_BeforeUpdate 0
End If
Select Case Me.StatusGroup.value
Case 1
Me.StatOpt1.Enabled = True
Me.StatOpt2.Enabled = True
Me.StatOpt3.Enabled = False
Case 2
Me.StatOpt1.Enabled = False
Me.StatOpt2.Enabled = True
Me.StatOpt3.Enabled = True
Case 3
Me.StatOpt1.Enabled = False
Me.StatOpt2.Enabled = False
Me.StatOpt3.Enabled = True
End Select
End Sub
DateBox 1 and 2 are text box that use date format.
In this code, the upper block runs a function that works normally by itself when the DateBox2 is updated. I'm just using the if statement to make sure the function has all its required value. The lower block, the statusgroup is a control group that has 3 radio buttons which is clearly named as StatOpt1 to 3. It should be noted that a similar code is used for the StatusGroup_after update event with a little tweak but it worked fine over there too. Both of these blocks is just to make it have a consistent display in the form. So I'm sure that this code itself is right.
I've tried to use only 1 of the code block and removing the me. prefixes but with no result. Also I tried using on load event, but it still gives same error message except refering to on load instead on current.
Can anyone help me?
UPDATE:
Apparently as I tried to tweak the other part of the form, the error seems to persist to ALL of the event procedure even the one that before I inserted this event procedure was working. I've tried by removing the code above just to make it work like it used to, but it gives the same error message.
Thank you in advance.