Solved

Access 2010 hide form/switchboard after open form selected

Posted on 2013-10-29
1
970 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
[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
1 Comment
 
LVL 48

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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
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…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

696 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