Solved

Access 2010 hide form/switchboard after open form selected

Posted on 2013-10-29
1
942 Views
Last Modified: 2013-10-29
On my Home page (Switchboard) "On Open" event I would like to close the form after the selection is made for R100, S100 or M100.

Here is current code:

Option Compare Database
Option Explicit

Private Sub Form_Open(Cancel As Integer)
If Forms("frmLogin").txUserLevel = 1 Then
  Me.R100.Enabled = False
  Me.S100.Enabled = False
  Me.M100.Enabled = True
ElseIf Forms("frmLogin").txUserLevel = 2 Then
  Me.R100.Enabled = False
  Me.S100.Enabled = True
  Me.M100.Enabled = False
ElseIf Forms("frmLogin").txUserLevel = 3 Then
  Me.R100.Enabled = True
  Me.S100.Enabled = False
  Me.M100.Enabled = False
ElseIf Forms("frmLogin").txUserLevel = 6 Then
  Me.R100.Enabled = True
  Me.S100.Enabled = True
  Me.M100.Enabled = False
End If
End Sub
0
Comment
Question by:NNiicckk
1 Comment
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 500 total points
ID: 39608583
You can write a line of code in each of those command buttons Click Event, something like:

Private Sub R100_Click

     Docmd.Openform "frm_R100"
     docmd.close acform, me.name

End Sub
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

762 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now