I've seen some threads on several forums concerning this, but they either have completely unapplicable Login Forms or just said they fixed it without defining in what way they ended up fixing it.
Seems pretty simple...
1st ISSUE:
My login form is as simple as I could find a decent example of...
Login: cboUser FROM tblUser... 5 Columns: [UserID], [Last] & [First], [UserPassword], [UserSecurity], [PWReset]
Password: txtPassword
Cancel: Exits Database
Submit: Runs the following code...
Code:
Option Compare DatabaseOption Explicit
Private Sub cboUser_AfterUpdate()
End Sub
Private Sub cmdSubmit_Click()
If IsNull(Me.cboUser) Then
MsgBox "Please select a user", vbCritical
Me.cboUser.SetFocus
Else
If Me.txtPassword = Me.cboUser.Column(2) Then
If Me.cboUser.Column(4) = True Then
DoCmd.OpenForm "frmPWReset", , , "[UserID] = " & Me.cboUser
End If
DoCmd.OpenForm "frmNav"
Me.Visible = False
Else
MsgBox "Password does not match", vbOKOnly
Me.txtPassword = Null
Me.txtPassword.SetFocus
End If
End If
End Sub
On frmRouterEntry...
I have a non-editable [txtAuthor] that I'd like to auto-populate with the [UserLogin] FROM tblUser with criteria drawn from the theoretically still open but not visible frmLogin
So I set the Default Value of that field to:
Code:
DLookUp("[UserLogin]","tblUser","'me.[txtAuthor].value= & [Forms]![frmLogin]![cboUser]'")
...which is drawing a value, but it's doing the DLookUp-first-value thing and not giving the actual active user... which is pretty important for the concept.
2nd ISSUE:
So after I fix that, on to the frmRouterSearch (that's still under kind of under construction) due to this issue...
The search button existing will be used to make a printable report.
I'll need a different command button that will search records for editing and bring up a separate but identical form to frmRouterEntry. Since the records will all be linked in this form, they should auto-populate without any issue, but here comes the login thing again... only the author should be able to edit these records.
Any help or guidance on these issues is greatly appreciated. I'd rather you just assume I'm a total noob and provide some context around your explanations... because if not it'll just send me on another waste a bunch of hours googling spree...
If anybody needs any more information or I wasn't clear on what I needed to accomplish, let me know... I need to have this thing done before Monday or I'm gonna get yelled at