Hello
I hope you guys can help me. I am very new to ADO...
I am creating a ADODB connection in a module and trying to access it
from a command button in a form.
Function fxEIDAssgn(plng EID As Long) As Boolean
Dim rsAssignedUser As ADODB.Recordset
Dim strSelectUser As String
Dim varUser As String
Set rsAssignedUser = New ADODB.Recordset
strSelectUser = "SELECT U.UserName " _
& "FROM tblUsers U INNER JOIN tblAssignedTo A ON
U.UID = A.UID " _
& "WHERE a.EID = " & plngEID
'open the ado recordset
rsAssignedUser. Open strSelectUser, cnnThisDB
varUser = rsAssignedUser. Fields("UserNam e").Value
End Function
I would like to get the user name from the strSelectUser to show up in
a message box in my form.
I get the error "object required".
Please help.
Thanks
Simone
I hope you guys can help me. I am very new to ADO...
I am creating a ADODB connection in a module and trying to access it
from a command button in a form.
Function fxEIDAssgn(plng EID As Long) As Boolean
Dim rsAssignedUser As ADODB.Recordset
Dim strSelectUser As String
Dim varUser As String
Set rsAssignedUser = New ADODB.Recordset
strSelectUser = "SELECT U.UserName " _
& "FROM tblUsers U INNER JOIN tblAssignedTo A ON
U.UID = A.UID " _
& "WHERE a.EID = " & plngEID
'open the ado recordset
rsAssignedUser. Open strSelectUser, cnnThisDB
varUser = rsAssignedUser. Fields("UserNam e").Value
End Function
I would like to get the user name from the strSelectUser to show up in
a message box in my form.
I get the error "object required".
Please help.
Thanks
Simone
Comment