I have a subform for which the data source is:
It resides on the main Groups form, tied to the master group record through GrpID.
I am able to edit most of the subform fields with no issue.
GrpLevSt and GrpLevEn, which are pulled from the master Group record via the join above, are actual fields which are not visible on the form. Their purpose is just to check the value entered in GrpLev and verify that it is not outside the limits set for that group. I added After Update coding to the GrpLev field to perform the comparison, and this is where the issue appears. The code:
When I set the value of GrpLev to a value which would violate the constraints, I get an error which states:
I get the same error when I attempt the comparison on the fields (Me.txtGrpLevSt.Value) or on the data (Me.GrpLevSt or Me.GrpLevSt.Value). Does anyone have any insight?
Cheryl dc Kern
Code:
SELECT dbo_GroupUsers.UID, dbo_GroupUsers.GrpID, dbo_GroupUsers.GrpLev, dbo_Groups.GrpLevSt, dbo_Groups.GrpLevEn FROM dbo_GroupUsers RIGHT JOIN dbo_Groups ON dbo_GroupUsers.GrpID=dbo_Groups.GrpID;
I am able to edit most of the subform fields with no issue.
GrpLevSt and GrpLevEn, which are pulled from the master Group record via the join above, are actual fields which are not visible on the form. Their purpose is just to check the value entered in GrpLev and verify that it is not outside the limits set for that group. I added After Update coding to the GrpLev field to perform the comparison, and this is where the issue appears. The code:
Code:
If Me.txtGrpLev.Value < Me.txtGrpLevSt.Value Then
MsgBox ("The minimum level in this group is " & Me.txtGrpLevSt.Value)
Me.txtGrpLev.Value = Me.txtGrpLevSt.Value
ElseIf Me.txtGrpLev.Value > Me.txtGrpLevEn.Value Then
MsgBox ("The maximum level in this group is " & Me.txtGrpLevEn.Value)
Me.txtGrpLev.Value = Me.txtGrpLevEn.Value
End If
The expression After Update you entered as the event property setting produced the following error: A problem occurred while Microsoft Office Access was communication with the OLE server or ActiveX Control.
*The expression may not result in the name of a macro, the name of a user-defined function, or [Event Procedure].
*There may have been an error evaluating the function, event, or macro.
I get the same error when I attempt the comparison on the fields (Me.txtGrpLevSt.Value) or on the data (Me.GrpLevSt or Me.GrpLevSt.Value). Does anyone have any insight?
Cheryl dc Kern