S
Simon Harris
Hi All,
I am trying to set the rowsource property of a list box using code.
Heres what I have, which is fired onload of the form:
'Set the Record Source for the customers list
Forms!frm_switchboard!SUBFRM_view_customers.RowSource = "SELECT
QRY_customers_view.ID, QRY_customers_view.surname,
QRY_customers_view.first_name AS Name, QRY_customers_view.company AS
Company, QRY_customers_view.tel AS Tel, QRY_customers_view.mobile AS Mobile,
QRY_customers_view.postcode AS Postcode, QRY_customers_view.type AS Type
FROM QRY_customers_view;"
MsgBox (Forms!frm_switchboard!SUBFRM_view_customers.RowSource)
Forms!frm_switchboard!SUBFRM_view_customers.Requery
Although there are no errors, I end up with nothing in the list box. Note
that the actual SQL I am trying to set as the rowsource is the original SQL
that was entered as the rowsource manually for the properties of the
listbox, so no probs there.
The MsgBox pops up what I expect - The SQL
Thanks
Simon.
--
-
* Please reply to group for the benefit of all
* Found the answer to your own question? Post it!
* Get a useful reply to one of your posts?...post an answer to another one
* Search first, post later : http://www.google.co.uk/groups
* Want my email address? Ask me in a post...Cos2MuchSpamMakesUFat!
I am trying to set the rowsource property of a list box using code.
Heres what I have, which is fired onload of the form:
'Set the Record Source for the customers list
Forms!frm_switchboard!SUBFRM_view_customers.RowSource = "SELECT
QRY_customers_view.ID, QRY_customers_view.surname,
QRY_customers_view.first_name AS Name, QRY_customers_view.company AS
Company, QRY_customers_view.tel AS Tel, QRY_customers_view.mobile AS Mobile,
QRY_customers_view.postcode AS Postcode, QRY_customers_view.type AS Type
FROM QRY_customers_view;"
MsgBox (Forms!frm_switchboard!SUBFRM_view_customers.RowSource)
Forms!frm_switchboard!SUBFRM_view_customers.Requery
Although there are no errors, I end up with nothing in the list box. Note
that the actual SQL I am trying to set as the rowsource is the original SQL
that was entered as the rowsource manually for the properties of the
listbox, so no probs there.
The MsgBox pops up what I expect - The SQL
Thanks
Simon.
--
-
* Please reply to group for the benefit of all
* Found the answer to your own question? Post it!
* Get a useful reply to one of your posts?...post an answer to another one
* Search first, post later : http://www.google.co.uk/groups
* Want my email address? Ask me in a post...Cos2MuchSpamMakesUFat!