Solved

Access 2010 hide form/switchboard after open form selected

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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
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…

867 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

21 Experts available now in Live!

Get 1:1 Help Now