Parameter Values

Fox123

New member
Local time
Today, 06:17
Joined
Nov 19, 2009
Messages
4
Good morning,

I am hoping someone can help with this. I have built a simple database with a login form for access.

The landing page for users once logged in allows them to select a date range to run a report or to enter data via a simple form based on one table.

As part of the landing page I have created a subform which generates a simple report from a query. The query requires the username entered at login so the values of the report are personalised for that user. The query works fine but after login the Parameter Value box comes up even though the query should work off the text box on the login page.

Can anyone suggest a way of overriding the parameter box?

Hope this makes sense!!!

Yours hopefully

Fox123 :(
 
Is the login form still loaded when the Query is run? What is the criteria, you are using to pick up the User Name?
 
Hi

The login form closes once logged in I think here is the VBA code

Private Sub Command4_Click()
Text5.SetFocus
If Text5 = "Admin" And Text2 = "Password0" Then
MsgBox "Access Granted", vbInformation, "RAC Inspections Engineer Quality Check"
DoCmd.Close
DoCmd.OpenForm "frmReportView"
ElseIf Text5 = "Emma Hopcroft" And Text2 = "Password1" Then
MsgBox "Access Granted", vbInformation, "RAC Inspections Engineer Quality Check"
DoCmd.Close
DoCmd.OpenForm "frmReportView"

ElseIf Text5 = "Rob Huskisson" And Text2 = "Password2" Then
MsgBox "Access Granted", vbInformation, "RAC Inspections Engineer Quality Check"
DoCmd.Close
DoCmd.OpenForm "frmReportView"

ElseIf Text5 = "Rob Williams" And Text2 = "Password3" Then
MsgBox "Access Granted", vbInformation, "RAC Inspections Engineer Quality Check"
DoCmd.Close
DoCmd.OpenForm "frmReportView"

ElseIf Text5 = "Stuart Fox" And Text2 = "Password4" Then
MsgBox "Access Granted", vbInformation, "RAC Inspections Engineer Quality Check"
DoCmd.Close
DoCmd.OpenForm "frmReportView"

ElseIf Text5 = "Keiron Palmer" And Text2 = "Password5" Then
MsgBox "Access Granted", vbInformation, "RAC Inspections Engineer Quality Check"
DoCmd.Close
DoCmd.OpenForm "frmReportView"
ElseIf Text5 = "Kit Patel" And Text2 = "Password6" Then
MsgBox "Access Granted", vbInformation, "RAC Inspections Engineer Quality Check"
DoCmd.Close
DoCmd.OpenForm "frmReportView"

ElseIf Text5 = "Chris Grima" And Text2 = "Password7" Then
MsgBox "Access Granted", vbInformation, "RAC Inspections Engineer Quality Check"
DoCmd.Close
DoCmd.OpenForm "frmReportView"

ElseIf Text5 = "Andy James" And Text2 = "Password8" Then
MsgBox "Access Granted", vbInformation, "RAC Inspections Engineer Quality Check"
DoCmd.Close
DoCmd.OpenForm "frmReportView"

ElseIf Text5 = "Shelly Sawford" And Text2 = "Password9" Then
MsgBox "Access Granted", vbInformation, "RAC Inspections Engineer Quality Check"
DoCmd.Close
DoCmd.OpenForm "frmReportView"

ElseIf Text5 = "Julie Cain" And Text2 = "Password10" Then
MsgBox "Access Granted", vbInformation, "RAC Inspections Engineer Quality Check"
DoCmd.Close
DoCmd.OpenForm "frmReportView"

ElseIf Text5 = "Nick Thompson" And Text2 = "Password11" Then
MsgBox "Access Granted", vbInformation, "RAC Inspections Engineer Quality Check"
DoCmd.Close
DoCmd.OpenForm "frmReportView"

ElseIf Text5 = "Olly Evans" And Text2 = "Password12" Then
MsgBox "Access Granted", vbInformation, "RAC Inspections Engineer Quality Check"
DoCmd.Close
DoCmd.OpenForm "frmReportView"

ElseIf Text5 = "Sean Connolly" And Text2 = "Password13" Then
MsgBox "Access Granted", vbInformation, "RAC Inspections Engineer Quality Check"
DoCmd.Close
DoCmd.OpenForm "frmReportView"

ElseIf Text5 = "Nicki Winpenny" And Text2 = "Password14" Then
MsgBox "Access Granted", vbInformation, "RAC Inspections Engineer Quality Check"
DoCmd.Close
DoCmd.OpenForm "frmReportView"

Else
MsgBox "Please re-enter your User Name and Password", vbInformation, "Login Details Unknown"
End If

End Sub


The query uses [forms]![frmLoginPage]![Text5]
 
The login form still needs to be loaded to pick up the info of Text5. Leave the login page open, and in the OnOpen event of your landing page, make the login form invisible.
Or
You can create a hidden text box on you landing page, put your info from Text5 in the hidden text box and then close the login page. Then you can reference the hidden text box.
Or
You can create a variable to store the Text5 info and then reference the variable.
 

Users who are viewing this thread

Back
Top Bottom