Hello Guys,
I am trying to retrieve a value through a SQL statement and place it into an unbound text-field. When I run the program, the immediate window shows me the correct information but the text-field shows (#Name?) What could be the problem?
Here is my code
Thank you for your help
I am trying to retrieve a value through a SQL statement and place it into an unbound text-field. When I run the program, the immediate window shows me the correct information but the text-field shows (#Name?) What could be the problem?
Here is my code
Code:
Private Sub cmdViewLogin_Click()
Dim PElogin As String
Dim strComments As String
strComments = "SELECT [Comments] FROM TblPEComments WHERE [Employee]='" & Me.Employee & "' And StateRegistered= '" & Me.StateID & "' And RegistrationNo='" & Me.RegistrationNo & "'"
Debug.Print strComments
PElogin = InputBox("Please Enter Password", "PE Login")
If PElogin = "password" Then
MsgBox "Thank You"
Me.Commentstxt.Visible = True
Me.Commentstxt.ControlSource = strComments
Else
MsgBox "Invalid Password!" & vbNewLine & "Please Contact Administrator" & vbNewLine, vbCritical
Exit Sub
End If
End Sub
Thank you for your help