G
Guest
Hi
I bascially want the user to login using an Inumber and password, from this
I look up the user table and find there name, Iam trying to pass this on to
the add session form so the the text field on this form will be already
filled with this name,
However at the moment I keep getting runtime error 2135 this property is
read only and cannot be set
login form code
Status = "X"
GBL_Status = Nz(DLookup("Status", "ServicePrep", "INumber='" &
Nz(Me.INumber, " ") & "' and Password='" & Nz(Me.Password, " ") & "'"), "X")
If GBL_Status = "X" Then
MsgBox "Invalid Username or Password... try again."
Me.INumber = ""
Me.Password = ""
Exit Sub
End If
Status = "Y"
GBL_Name = Nz(DLookup("Name", "ServicePrep", "INumber='" & Nz(Me.INumber, "
") & "' and Password='" & Nz(Me.Password, " ") & "'"), "Y")
Case "Prep"
stDocName = "Add Session"
stLinkCriteria = "[GBL_Name] = " & GBL_Name
DoCmd.OpenForm stDocName, , , , , , GBL_Name
Me.Visible = False
End Select
add session code
Private Sub Add_Click()
On Error GoTo Err_Add_Click
DoCmd.GoToRecord , , acNewRec
Exit_Add_Click:
Exit Sub
Err_Add_Click:
MsgBox Err.Description
Resume Exit_Add_Click
End Sub
Private Sub Close_Click()
On Error GoTo Err_Close_Click
DoCmd.Close
Exit_Close_Click:
Exit Sub
Err_Close_Click:
MsgBox Err.Description
Resume Exit_Close_Click
End Sub
Private Sub Form_Open(Cancel As Integer)
DoCmd.GoToRecord , , acNewRec
End Sub
Private Sub Form_Load()
Me.[Name] = Me.OpenArgs
MsgBox Name
End Sub
Any help with this would be appreciated,
Thanks
I bascially want the user to login using an Inumber and password, from this
I look up the user table and find there name, Iam trying to pass this on to
the add session form so the the text field on this form will be already
filled with this name,
However at the moment I keep getting runtime error 2135 this property is
read only and cannot be set
login form code
Status = "X"
GBL_Status = Nz(DLookup("Status", "ServicePrep", "INumber='" &
Nz(Me.INumber, " ") & "' and Password='" & Nz(Me.Password, " ") & "'"), "X")
If GBL_Status = "X" Then
MsgBox "Invalid Username or Password... try again."
Me.INumber = ""
Me.Password = ""
Exit Sub
End If
Status = "Y"
GBL_Name = Nz(DLookup("Name", "ServicePrep", "INumber='" & Nz(Me.INumber, "
") & "' and Password='" & Nz(Me.Password, " ") & "'"), "Y")
Case "Prep"
stDocName = "Add Session"
stLinkCriteria = "[GBL_Name] = " & GBL_Name
DoCmd.OpenForm stDocName, , , , , , GBL_Name
Me.Visible = False
End Select
add session code
Private Sub Add_Click()
On Error GoTo Err_Add_Click
DoCmd.GoToRecord , , acNewRec
Exit_Add_Click:
Exit Sub
Err_Add_Click:
MsgBox Err.Description
Resume Exit_Add_Click
End Sub
Private Sub Close_Click()
On Error GoTo Err_Close_Click
DoCmd.Close
Exit_Close_Click:
Exit Sub
Err_Close_Click:
MsgBox Err.Description
Resume Exit_Close_Click
End Sub
Private Sub Form_Open(Cancel As Integer)
DoCmd.GoToRecord , , acNewRec
End Sub
Private Sub Form_Load()
Me.[Name] = Me.OpenArgs
MsgBox Name
End Sub
Any help with this would be appreciated,
Thanks