Use VB expression as control source?

B

Bryan

I have a form with several pairs of combo boxes on it. When I select a value
from one of a pair, I want the other of the pair to update itself to reflect
it's associated value. I have a variable that I holds the value, but I can't
get it to show up in the combo box. I have a .refresh method in the Sub
after the variable is updated, and while it appears as though the form
refreshes, the combo box remains blank.

I have also been trying to get a text box to display the results of a VB
string, but I get "#Name?" in the box when I run the form. The string is a
concatenation of several variables.

Thanks for any help!
 
L

Larry Linson

It's difficult, at best, to debug remotely. With only a general description,
we could only respond with useful help if you had described a major, known,
bug in the software -- and those, thank goodness, are highly unusual.

In the first case, there are a number of examples of "cascading combo" at
various locations. I have one at http://accdevel.tripod.com/ for
"QueryByForm with Three Combo Boxes" in Access 97 format (should convert to
later versions without problem). If you refer to the earlier Combo in the
SQL or Query you use for the later one, then in the AfterUpdate event of the
earlier Combo, you should Requery the later one, not "Refresh" (there's
instructive Help that describes the difference between Requery and Refresh
in Access 2003 Help). If this doesn't help you solve the problem, post back
here with clarification and detail.

Exactly what is the Control Source you are using that is failing (and
details of any other VB code it may reference, e.g. if it is a function).
You can certainly use an expression, or refer to a VB function, in the
Control Source. But, again, the "Devil is in the Details", which are right
in front of you, but we have to rely on what you write.

Larry Linson
Microsoft Office Access MVP
 

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