Open a specific form based on log-in

R

REGREGL

Hey all...

Is it possible to open a specific form based on the log-in that the User
implimented? For instance, I have 3 groups (not user groups, no security
setup currently). They are Sales Support. Order Entry and Ad Production.
Each gropu has a different form that they work from. I can create a table
with the employee name, user group and employee id. Upon opening the
application, I can create an autoexec macro to ask for employee id. When the
employee enters their ID, can I then have the application open the specific
form for their user group and filter their records to show only those
accounts assigned to the specific employee?

Thanks in advance fo any assistance you can provide!
 
K

KARL DEWEY

Create a table listing users and field designating their group. Create a
form with combo with the user list table as source. Set 'On Update' property
of combo to run macro with multiple actions, each with a condition checking
the combo for group so as to open the correct form.
 
R

REGREGL

Karl,

thank you for answering this so quickly! I'm a little lost when you say "
run macro with multiple actions..." What actions would I have the macro run
to determine which form to open?


Thanks again.
 
K

KARL DEWEY

The action is to open Form1 with condition the individual selected the name
of someone in Group1 in the logon form. Open Form2 is second action in the
macro with condition individual in 2nd group.
 
J

John W. Vinson

Hey all...

Is it possible to open a specific form based on the log-in that the User
implimented? For instance, I have 3 groups (not user groups, no security
setup currently). They are Sales Support. Order Entry and Ad Production.
Each gropu has a different form that they work from. I can create a table
with the employee name, user group and employee id. Upon opening the
application, I can create an autoexec macro to ask for employee id. When the
employee enters their ID, can I then have the application open the specific
form for their user group and filter their records to show only those
accounts assigned to the specific employee?

Thanks in advance fo any assistance you can provide!

Rather than using a macro, I would suggest opening an unbound form with a
Combo Box or Listbox on it. This control would be based on a query of your
table so the user can select their own name, and would include the group as
its second field. In the AfterUpdate event of the combo, open the desired
form, using code like

Private Sub cboEmployee_AfterUpdate()
Select Case Me!cboEmployee.Column(1) ' get the 2nd column, the user group
Case "Sales Support"
DoCmd.OpenForm "frmSalesSupport"
Case "Order Entry"
DoCmd.OpenForm "frmOrderEntry"
Case "Ad Production"
DoCmd.OpenForm "frmAdProduction"
Case Else
MsgBox "You're not allowed to do ANYTHING!", vbOKOnly
End Select
DoCmd.Close acDataForm, Me.Name
End Sub
 
R

REGREGL

Thanks everyone!

It looks like either of these proceedures wuold open the form I want.
However, I still need the data to be filtered to just include the orders
assigned to the particular rep. I do not want someone else looking at files
assigned to a different rep.
 
J

John W. Vinson

Thanks everyone!

It looks like either of these proceedures wuold open the form I want.
However, I still need the data to be filtered to just include the orders
assigned to the particular rep. I do not want someone else looking at files
assigned to a different rep.

Then base the Form on a query using the startup form's combo box as a
criterion, and rather than closing the startup form set its Visible property
to False.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top