Referencing a property in a combo box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I have a form called (Ex: "FormA") with a subform in it called (Ex:
"SForm"). In SForm form I have a combo box called "ComboBox".

Through code in the SForm form I would like to load a query called ("Q1") in
the RowSource property of the ComboBox control. I am currently using the
following command, but I have been unsuccessfull:

[Forms]![FormA]![SForm].[Form]![ComboBox].Properties("Row Source") = Q1

Can anyone help?
Best regards
Robert
 
Any of the following should reference the RowSource (all one word) property
[Forms]![FormA]![SForm].[Form]![ComboBox].Properties("RowSource")
[Forms]![FormA]![SForm].[Form]![ComboBox].RowSource
[Forms]![FormA]![SForm].[Form]![ComboBox]!RowSource

The RowSource property is used to hold a SQL string, which, for the query
Q1, would be referenced by
CurrentDb.QueryDefs("Q1").SQL

Hope This Helps
Gerald Stanley MCSD
 
Back
Top