Populate Combobox from a pre-stored parametriced Access-Query -
i'm workin ms access 2010 database. need combobox show result of sql select sentence time sql sentence long asigned rowsource property of combobox.
to solve problem have created accesss-query , stored in access database queries section name "myquery". it's sql code similar longer following query:
parameters [myparameter] long; select field1, field2, field3 [mytable] [mytable]![fieldn] = [myparameter]
as can see, query has parameter.
once created query changed vb code this:
me.mycombo.rowsource = "myquery" 'the name of query created before me.mycombobox.requery 'execute query populate combobox
it works fine before each execution ms-access shows pop-up window asking value of parameter.
¿how can avoid pop-up window , asign or bind value parameter each time new population needed? like
me.mycombo.rowsource = "myquery" 'the name of query created before me.mycombobox.rowsource.parameters("[myparameter]") = me.formfield1.value me.mycombobox.requery 'execute query populate combobox
is there other way solve issue?
thanks
since parameter based on field in form, i'd replace parameter in query direct reference form field.
select field1, field2, field3 [mytable] [mytable]![fieldn] = [forms]![formname]![formfield1]
Comments
Post a Comment