Susan Harkins
harkins at iglou.com
Sun Aug 17 13:37:44 CDT 2003
I'm using the SysCmd function to determine an object's state. Problem is, the integer values the function's returning, doesn't match the constants. The Object Browser and the Immediate window both use the following: 'acObjStateOpen The object is open 1 'acObjStateNew The object is new 4 'acObjStateDirty A change has been made, but unsaved 2 But I get 1, 5, an 3, respectively when I run the function (below). Also, 7 turns up with a new form that's had default properties reset but not saved. I've checked the object browser, but I'm not getting much help -- everything refers to 1, 4, and 2. Anybody know more about 3, 5, and 7? I'm using Access XP but you'd think the browser would reflect changes to the constants if they'd been made from one version to another? Thanks! Susan H. Public Function ObjState(Optional objname As Variant, _ Optional objtype As Variant) As Variant 'determine whether the object is 'selected or passed via arguments Dim intState As Integer If IsMissing(objname) = True Then 'if using current object ObjState = SysCmd(acSysCmdGetObjectState, _ Application.CurrentObjectType, _ Application.CurrentObjectName) 'if using passed argument Else ObjState = SysCmd(acSysCmdGetObjectState, _ objtype, objname) End If End Function