Solved

Access 2010 hide form/switchboard after open form selected

Posted on 2013-10-29
1
957 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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
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…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

825 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