Help on a Drop down or listbox on a VBA form?


Posted by Phil on June 26, 2000 12:52 PM

I am simply trying to put a selection list on a VBA form that is linked back to a range of cells. I have found code that is made for this, but I cant get it to work. The code I am attempting to use is "ActiveDialog.listboxes("listbox1").ListFillRange = "sheet!$a$2:$a$5".

I receive a "Run Time Error 91" "Object Variable or With Block Variable not Set"

Can anyone tell me the correct way to do this. Surely it cant be that complicated. Thanks

Posted by murali on October 30, 2000 2:58 AM

:I want to access database using listbox properties alone



Posted by Ryan on June 26, 0100 4:15 PM

Phil,
If you look at the properties for the listbox, you can enter in the row source in there, instead of doing it with code. It looks from you code you posted that you may have an error. I don't know if the ListFillRange you entered in a generic one, but you just have "sheet!". I don't know if you forgot the 1 or not. Just a thought. Hope this helps. Let me know.
Ryan