Originally Posted by
Ajax
OK I can see how the confusion has arisen.
"[UserID] = " & lstClients.Column(0)
only needs to be this
"[UserID] = " & lstClients
Alright, I changed the lstClients On Dbl Click and it still opens the records associated with the selection. I also changed it for lstProjects (the one that's been giving me troubles) and it still isn't working...it still opens the form with as a new record. Here is the On Dbl Click VBA for both:
Code:
Private Sub lstClients_DblClick(Cancel As Integer)
DoCmd.OpenForm "NewClient", , , "[UserID] = " & lstClients
End Sub
Private Sub lstProjects_DblClick(Cancel As Integer)
DoCmd.OpenForm "Projects", , , "[ProjectID] = " & lstProjects
End Sub
Here is the RowSource for lstClients. Column 1 is the bound column.
Code:
SELECT Clients.UserID, Clients.FirstName, Clients.LastName, Clients.University FROM Clients WHERE (((Clients.FirstName) Like "*" & Forms!SelectClient!txtKeyword.TEXT & "*")) Or (((Clients.LastName) Like "*" & Forms!SelectClient!txtKeyword.TEXT & "*")) ORDER BY Clients.LastName;
Here is the RowSource for lstProjects. lstProjects is filtered based on the selection from lstClients. Column 1 is the bound column.
Code:
SELECT Projects.ProjectID, Projects.UserID, Projects.ProjectResearcher, Projects.ProjectTitle FROM Clients INNER JOIN Projects ON Clients.UserID = Projects.UserID WHERE (((Projects.UserID)=[Forms]![SelectClient]![lstClients]));
I also repaired/compacted and attached the database in case that would help. Attachment 23530