hi,
i want to use a dynamic query but instead of opening it once it is executed, i want the result to be displayed in a text box.
i would also like to know if anyone can tell me how to write code to select just a field from a recordset (is recordset = query ?). example:
i have a query with three names bob, frank, sara.
i want to select just bob from the query and put it in a textbox on my form.
(i know i could use, the record source and the wizard) BUT:
i need to do by means of code, because i plan on having three buttons. when button one is clicked, it selects the first person from the query and displays his name in the textbox. and then button two does the same but for the second person in the same query.
i hope you understand my questions?
in other words: is it possible to do something similar to this:
textboxname = forms!formname!lstboxname.itemdata(1)
BUT with a query? or recordset?
thanks
i want to use a dynamic query but instead of opening it once it is executed, i want the result to be displayed in a text box.
i would also like to know if anyone can tell me how to write code to select just a field from a recordset (is recordset = query ?). example:
i have a query with three names bob, frank, sara.
i want to select just bob from the query and put it in a textbox on my form.
(i know i could use, the record source and the wizard) BUT:
i need to do by means of code, because i plan on having three buttons. when button one is clicked, it selects the first person from the query and displays his name in the textbox. and then button two does the same but for the second person in the same query.
i hope you understand my questions?
in other words: is it possible to do something similar to this:
textboxname = forms!formname!lstboxname.itemdata(1)
BUT with a query? or recordset?
thanks