Programatically update Pop Up property

Capitala

Member
Local time
Today, 09:44
Joined
Oct 21, 2021
Messages
91
Good day!
I need to change the property "Pop up" for all forms depending on user name.
i.e. if username is "abc" then all forms pop up property will be "yes" otherwise, it will be set to "no"
Thanks in advance
 
set all form property popup = no,
put all user names into a table, for those that get popup
then get username and OPEN the form as popup:

Code:
dim bFound as boolean
vUser =  Environ("Username")
bFound =not IsNull( Dlookup("[userid]","tUsers","[UserID]='" * vUser & "'"))

if bFound then
   docmd.OpenForm "fMyform",,,,,acDialog
else
   docmd.OpenForm "fMyform"
endif
 
do you mean just the popup property or the the modal property as well? acDialog will also set the modal property which means user cannot leave the form until they close it.

If just the popup property then in addition to ranmans suggestion, in each form open event put the code

me.modal=false

a shorter version to ranmans suggestion (and corrected the *)

docmd.OpenForm "fMyform",,,,,DCount("[userid]","tUsers","[UserID]='" & vUser & "'")*-3
 

Users who are viewing this thread

Back
Top Bottom