Not sure this is correct forum, but I have a question about a bit of VBA code that opens various forms in my Database...
A form gets opened depending upon the PIN code.
Here's the code:
Private Sub PinCode_Click()
Dim strInput as string
strInput=InputBox("Enter your PIN Code"
'Depending on PIN Code, a different form opens.
Select Case strInput
'PIN Code "1234" opens frmX
Case 1234
DoCmd.OpenForm "frmX",acNormal
'PIN Code "5678" opens frmY
Case 5678
DoCmd.OpenForm "frmY",acNormal
....and so on. But here is my problem
'The PIN Code entered by the employee needs to open _
'frmZ to that employee's record. It's this next Case
'that is giving me trouble...
Case WHAT GOES HERE? HOW DO I TAKE THE PIN CODE
ENTERED BY THE EMPLOYEE AND "LINK" IT TO THAT
EMPLOYEE'S RECORD ON frmZ?
The Else Case is reserved for a msgbox "Invalid
Entry.Try Again"
To make matters worse, the form I want to open has a subform.
A form gets opened depending upon the PIN code.
Here's the code:
Private Sub PinCode_Click()
Dim strInput as string
strInput=InputBox("Enter your PIN Code"
'Depending on PIN Code, a different form opens.
Select Case strInput
'PIN Code "1234" opens frmX
Case 1234
DoCmd.OpenForm "frmX",acNormal
'PIN Code "5678" opens frmY
Case 5678
DoCmd.OpenForm "frmY",acNormal
....and so on. But here is my problem
'The PIN Code entered by the employee needs to open _
'frmZ to that employee's record. It's this next Case
'that is giving me trouble...
Case WHAT GOES HERE? HOW DO I TAKE THE PIN CODE
ENTERED BY THE EMPLOYEE AND "LINK" IT TO THAT
EMPLOYEE'S RECORD ON frmZ?
The Else Case is reserved for a msgbox "Invalid
Entry.Try Again"
To make matters worse, the form I want to open has a subform.