[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Access 2010 hide form/switchboard after open form selected

Posted on 2013-10-29
1
Medium Priority
?
990 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 49

Accepted Solution

by:
Dale Fye earned 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

834 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