[AccessD] SysCmd constant conflict

MartyConnelly martyconnelly at shaw.ca
Sun Aug 17 17:07:00 CDT 2003


You would get a 0 returned if the object is closed.

See this post by Terry Kreft and code to explain the bitmask
http://groups.google.com/groups?q=acObjStateDirty+acObjStateNew&hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=79maq6%24div%242%40gate.mps.co.uk&rnum=1

Susan Harkins wrote:

>>'acObjStateOpen  The object is open  1
>>'acObjStateNew   The object is new   4
>>    
>>
>
>Good guess, but I don't think so. Why would they double-cover a new object
>like that -- I mean there's no such thing as a closed new object, right? New
>implies unsaved. And 7 showed up with a new object where I changed a default
>property -- if it were new and unsaved, that would be 4 and 2 = 6.
>
>Susan H.
>
>  
>
>>>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
>>>
>>>_______________________________________________
>>>AccessD mailing list
>>>AccessD at databaseadvisors.com
>>>http://databaseadvisors.com/mailman/listinfo/accessd
>>>Website: http://www.databaseadvisors.com
>>>
>>>
>>>
>>>      
>>>
>>_______________________________________________
>>AccessD mailing list
>>AccessD at databaseadvisors.com
>>http://databaseadvisors.com/mailman/listinfo/accessd
>>Website: http://www.databaseadvisors.com
>>
>>
>>    
>>
>
>_______________________________________________
>AccessD mailing list
>AccessD at databaseadvisors.com
>http://databaseadvisors.com/mailman/listinfo/accessd
>Website: http://www.databaseadvisors.com
>
>  
>




More information about the AccessD mailing list