Visual basic code of combo box used for parameter query

N

Nandini

I created a bibliographic database using Access 2003. Here I have desiend
some parameter queries from which data can be retrieved using 2 combo boxes
placed in a form. One is for showing the field value and other is for
inputing related data after selecting the item in the previous box. Then the
query is to run through a command button. I got very good result as i wanted.
But one thing, I want to store and to show values as put in the 2nd combo box
till the database remains opend at a time.
Please send me the exact visual code for row source poperty of the 2nd combo
box or any other suitable answer.
With best regards.
 
J

John Spencer

If the 2nd combobox is to be based on your inputs then in the code that
runs the query you could add the value to the list.

UNTESTED

Your combobox should be set up as follows
Name: CboxNewValue
Control Source: Blank
Row Source Type: Value List
Row Source: Blank

Your code that runs the query would then need to add the lines

Me.CboxNewValue.RowSource = Me.CboxNewValue.RowSource & ";" & Chr(34) &
Me.CboxNewValue & Chr(34)

If the values are not text you should be able to remove the & Chr(34)
from the above.

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top