×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

changing properties on a form for another form

changing properties on a form for another form

changing properties on a form for another form

(OP)
I have a database that I need to change the properties of command buttons based on the input of a user.  I have a main form that pops up when the database is open and asks the user to enter a password.  Based on that password the user will have rights to other forms.  What code do I need to write to change the properties of buttons on different forms from my main form?  the code I use for the buttons on my main form are me.command1.enabled = true that works but if I try to change the properties for buttons on other forms
it will not let me.  How can I do this?  Thank You so much

               Travis

RE: changing properties on a form for another form

declare a global variable depending on how many different types of users you have

the easiest way would be to declare a string and have a table to cross reference usernames passwords and security priveleges

on open of every form do a select statement
eg.
Module 1
dim global UserType as string
function Startup()
docmd.openform "frmLogin", vbModal
end function

in your autoexec macro just runcode startup

then in your login form after they enter their username and password first check to make sure it's the right password then check their usertype and make
UserType = whatever is in the table for that user

on open of every form

select case UserType
case "Admin"
everything.visible = true or
everything.enabled = true

case "Bookeeper"
bookeeping.visible or enabled = true
everythingelse.visible or enabled = false

and so on for every type of user you have
end select

Hope this helps.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close