Populate a text box after update

L

laura

I am relatively new to Access programming. I have a database with a combo
box in which a user can select a task. The selection of the task in the
combo box runs code that populates a benchmark text box with a number
(example: the user chooses "Phone Call" in the task combo box, the benchmark
text box populates with "7"). I want to add another entered text box that
will look at the benchmark text box and it there is something in it, then it
populates with text, if the benchmark text box is blank then it leaves the
entered text box blank also. Please help. Thanks!
 
J

Jeff Boyce

Laura

What's the source of that additional data? Any chance you can include it as
one of the columns in the combobox's query (it wouldn't have to be visible)?

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
L

laura

The benchmark data comes from VB code that says if the task = "phone call",
then benchmark = "7". Now I want to say if the Benchmark is not blank,
return "text" into another text box.
 
J

Jeff Boyce

So you're saying that for each option chosen, you have to
include/update/maintain your VB code?

Another option that Access offers is the notion of a "lookup table". In
that table, you'd pair chosen values ("phone call", etc.) with their
corresponding benchmark values (ie., "7", etc.).

That way, you could use a combobox in your form to allow folks to select the
proper "task", and have Access automatically identify the correct
"benchmark". And when a new task pops up, you just make an entry in the
lookup table -- that's all!

(by the way, if there really is a one-for-one relationship between task and
benchmark, you don't need to store the benchmark. Knowing the task means
knowing the benchmark.)

Good luck!

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
L

laura

That would be much simpler than what I was doing I think. I will give that a
shot! Thanks for your help Jeff.
 

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