textbox to listbox - how to change dynamically

francoiss

Registered User.
Local time
Tomorrow, 07:59
Joined
Mar 6, 2007
Messages
14
does anybody here knows how to do this using vba in ms access?
thanks... :)
 
Use a class Molule to do this.

Open the form in design view, changes the datatype of the subject control to Listbox. Modify whatever listbox properties are appropriate, i.e. rowsource, column count, column width, width, height.

I don't think that you've thought this threw. Why not just create the listbox and keep it hidden until needed, then on some event hide the textbox and display the listbox and, on some other event, display the textbox and hide the list box.

The latter is significantly easier that imprementing what you asked.
 
Use a class Molule to do this.

Open the form in design view, changes the datatype of the subject control to Listbox. Modify whatever listbox properties are appropriate, i.e. rowsource, column count, column width, width, height.

I don't think that you've thought this threw. Why not just create the listbox and keep it hidden until needed, then on some event hide the textbox and display the listbox and, on some other event, display the textbox and hide the list box.

The latter is significantly easier that imprementing what you asked.

hey llkhoutx ....thank you so much!!!! =)
 
llkhoutx -

i'm a total newb to Access. i'm developing a small return merchandise authorization db for my company, and have run into a problem. i have comboBox1, and comboBox2; and depending on what is chosen from comboBox1, certain content in comboBox2 will be available.

in your previous post, you said "Why not just create the listbox and keep it hidden until needed, then on some event hide the textbox and display the listbox and, on some other event, display the textbox and hide the list box."

that sounds similar to what im trying to do. how do i go about doing this?

i found this:
http://www.access-programmers.co.uk/forums/showthread.php?t=72876&highlight=control+box+depend

, but i did not find it very helpful. any help would be greatly appreciated. i tried searching but couldnt find what i need. if i am not following proper protocol, please let me know. thank you.

ps - i have some object oriented programming experience, but no experience w/ MS Access.
 
When do you want a listbox and when do you want a textbox?

On the former condition or event:
Forms!YourFormName!ListboxName.visible=true
Forms!YourFormName!TextboxName.visible=false

On the latter condition or event:
Forms!YourFormName!ListboxName.visible=false
Forms!YourFormName!TextboxName.visible=true

Voila!
 
Sorry I think my previous post was misleading. What I meant to ask was...

In a form, i have comboBox1, and comboBox2. And depending on what is chosen from comboBox1, I need certain content in comboBox2 will be available for selecting.

example:

in comboBox1, if i select "Chevy", then i want comboBox2 to only have "Silverado", "Malibu", and " "Aveo".

whereas if...

in comboBox1, i select "Toyota", then i want comboBox2 to only have "Tundra", "Camry", and "Corolla"

Thanks again.
 
You want to search for "cascading" combo boxes.
 
Thank you!

You want to search for "cascading" combo boxes.

pbaldy - thank you for pointing me in the right direction! i got my cascading combo boxes to work, and learned a few new things along the way :) . i've come to another problem, but i will post in a separate thread.
 

Users who are viewing this thread

Back
Top Bottom