I have a subform as part of my main form in my Access DB. All the data is in linked tables that are linked to a SQL Server DB. I am not able to figure out how to correctly fill the list box based on a query of on one of the linked tables. I thought I had it working only to find that I don't. I'm not sure if I have the code in the correct place or if I have the code even correct. Here is what I have:
Forms![DATASHEET - CAF2]![Project_Permit]!Permits!RowSource = "select pc.Value Permit from pmdb.Project_Permit pp" _
& " left join pmdb.PicklistChild pc on pc.Id = pp.Permit " _
& " where Project = '" & ProjectNum & "' and ProjectType = " & ProjectTypenum _
& " and GroupID = '" & GROUPID & "';"
This is in the Form_Load()
sub for the main form.
Should this be in the subform?
Or is my code wrong?
Or both?