Hi,
Its me again. After looking far and wide, I came up with this code:
Private Sub Command2_Click()
Dim Conn As Connection
Dim rst As Recordset
Dim strSQL As String
Set Conn = Text0.Value
strSQL = "SELECT FirstName, LastName FROM Employees WHERE EmployeeID " & "' & EmployeeID & '"
rst.Open strSQL, Conn
If Not rst.EOF Then
Text0.Value = rst.Fields("FirstName") & " " & rst.Fields("LastName")
End If
'Me.Text0 = Me.Text0 & " This is just a text." & vbCrLf
End Sub
But I am having great difficulty to get this code to work. The error message I keep receiving saids, 'Object required'. Can anyone help me write this code so that it will work well.
Thank you in advance for your help.
James
Its me again. After looking far and wide, I came up with this code:
Private Sub Command2_Click()
Dim Conn As Connection
Dim rst As Recordset
Dim strSQL As String
Set Conn = Text0.Value
strSQL = "SELECT FirstName, LastName FROM Employees WHERE EmployeeID " & "' & EmployeeID & '"
rst.Open strSQL, Conn
If Not rst.EOF Then
Text0.Value = rst.Fields("FirstName") & " " & rst.Fields("LastName")
End If
'Me.Text0 = Me.Text0 & " This is just a text." & vbCrLf
End Sub
But I am having great difficulty to get this code to work. The error message I keep receiving saids, 'Object required'. Can anyone help me write this code so that it will work well.
Thank you in advance for your help.

James