Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Enabling and disabling controls on switchboard form

Posted on 2004-03-31
7
Medium Priority
?
438 Views
Last Modified: 2006-11-17
First question is how do I create a switchboard without usingt the wizard ? if I have a switchboard and how do I disable buttons based
on users workgroup?
0
Comment
Question by:llegaspi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 6

Expert Comment

by:Plamodo
ID: 10726728
You can create a form and use it as a switchboard.  Then on that form, you can enable and disable buttons with :

cmdGo.enabled = true
cmdGo.enabled = false

0
 
LVL 51

Assisted Solution

by:Steve Bink
Steve Bink earned 500 total points
ID: 10726837
Do it the way I learned it!  Make a switchboard with the wizard, then go through and dissect the code.  All the wizard is create one table (Switchboard Items) and one form (Switchboard).  Open up the table in datasheet view, the form in design view, and trace the code in your head to see what it does.  It really is a pretty decent setup, and completely customizable if you want to change it around.
0
 

Author Comment

by:llegaspi
ID: 10758076
But how do I disable buttons based on user's login
0
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 
LVL 51

Accepted Solution

by:
Steve Bink earned 500 total points
ID: 10759421
Select Case of DBEngine.Workspaces(0).UserName
   Case "User1": MyControl1.Enabled = False: MyControl2.Enabled = True
   Case "User2": MyControl1.Enabled = True: MyControl2.Enabled = False
   Case Else:
       ' Whatever else you need...
End Select
0
 

Author Comment

by:llegaspi
ID: 10761231
Routinet,

Where do I put this code? i have no clue.

Thanks,
Lourdes
0
 
LVL 51

Assisted Solution

by:Steve Bink
Steve Bink earned 500 total points
ID: 10761852
The most likely place for that particular code would be the OnLoad event for the form.  

I cannot stress enough the value of dissecting the code generated by the switchboard wizard.  It can be a great tutorial for altering forms on the fly, as well as opening recordsets and dealing with them.  You don't need very strong skills in VB; you can trace through the switchboard code and use the Object Browser to look up any methods or properties you don't understand.
0
 
LVL 6

Expert Comment

by:Plamodo
ID: 10762152
To get to the OnLoad event for the form, open the form in design mode... move your mouse to the box in the upperleft corner of the window and right-click ... select 'Build Event' and choose "code builder" .. this will automatically place you in the OnLoad event of the form.
0

Featured Post

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question