Dynamic switchboard

  • Thread starter karen scheu via AccessMonster.com
  • Start date
K

karen scheu via AccessMonster.com

I need to accomplish to things with a switchboard form and I need to know if
it is possible.

1. Dynamically set the list of switchboard items based on the user that logs
in. I created a t_user table that will keep information such as what report
options are available for that user. Is it possible to load the switchboard
items from a table dynamically? I don't want to simply hide an option
because then there will be too many spaces between options.

2. I need to put an image next to the options on the switchboard.

Thanks for your help.

Karen
 
G

Guest

The only way I've seen it done is to specify the location on the form for
each control (e.g. button on the switchboard) in the VBA code. That is, when
you open the form (switchboard), specify which button/box appears where on
the form based on the user name - something like this (assuming that you
capture the current user's logon ID to a global variable called UserName
before the switchboard is opened):

Private Sub Form_Open(Cancel As Integer)
Select Case UserName
Case Is = "Joe"
TextBox1.Visible = True
TextBox1.Top = 2
TextBox2.Visible = False
Button1.Visible = True
Button1.Top = 3
Case Is = "Susan"
TextBox1.Visible = False
TextBox2.Visible = True
TextBox2.Top = 2
Button1.Visible = True
Button1.Top = 3
End Sub

I usually find it MUCH easier to just leave all the options on the form, but
enable or disable them based on the user's security level. This way, the
section above just becomes this:

Private Sub Form_Open(Cancel As Integer)
Case Is = "Joe"
TextBox1.Enabled = True
TextBox2.Enabled = False
Button1.Enabled = True
Case Is = "Susan"
TextBox1.Enabled = False
TextBox2.Enabled = True
Button1.Enabled = True
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top