Richard1941
Registered User.
- Local time
- Today, 07:56
- Joined
- Oct 29, 2012
- Messages
- 34
I have a main form that has 3 pages. On the third page I want to retrive a list of records related to a combobox on that page, but not related to anything on the main form. First I tried to code the AfterUpdate action for the combobox with:
So then I tried putting in the AfterUpdate action:
strSQL = "SELECT qryBusinessesByCategory.Category, qryBusinessesByCategory.FirmName, qryBusinessesByCategory.Address1, qryBusinessesByCategory.City, qryBusinessesByCategory.Email, qryBusinessesByCategory.ContactPerson, qryBusinessesByCategory.Phone, qryBusinessesByCategory.Website " & _
"FROM qryBusinessesByCategory WHERE (((qryBusinessesByCategory.Category)=" & "'" & Me!Category & "'))"
Me!subfrmBusinessesByCategory.Form!Category.RowSourceType = "Table/Query"
Me!subfrmBusinessesByCategory.Form!Category.[Record Source]
But that produced an error saying that control doesn't support the RowSource parameter."FROM qryBusinessesByCategory WHERE (((qryBusinessesByCategory.Category)=" & "'" & Me!Category & "'))"
Me!subfrmBusinessesByCategory.Form!Category.RowSourceType = "Table/Query"
Me!subfrmBusinessesByCategory.Form!Category.[Record Source]
So then I tried putting in the AfterUpdate action:
[TempVars]![BusinessCategory] = Me![Category].Value
and using for the RecordSource for the subform:
SELECT qryBusinessesByCategory.Category, qryBusinessesByCategory.FirmName, qryBusinessesByCategory.Address1, qryBusinessesByCategory.City, qryBusinessesByCategory.Email, qryBusinessesByCategory.ContactPerson, qryBusinessesByCategory.Phone, qryBusinessesByCategory.Website FROM qryBusinessesByCategory WHERE (((qryBusinessesByCategory.Category)=[TempVars]![BusinessCategory]));
No error messages, but no data in the subform either. How do I get the subform to populate after the control on the main form has had a selection?