Requery / Refresh calculated texbox

G

George

Dear friends,

On a form I have two textboxes (cbo1 and cbo2).

I need to have a formula in cbo2 (eg [cbo1]*10, that will use what I type in
cbo1.

The problem is that I need by changing the value in cbo1, immediately to
have the result in cbo2.

e.g. I type 1 in cob1 = 10 will be shown in cbo2,
by typing more in cob1, e.g. 11, in cbo2 will be shown 110.

This should be done before update? Where shall I use the requery method?

Thanking you in advance,

GeorgeC
 
L

Linq Adams via AccessMonster.com

You can do this one of two ways:

Either

Private Sub cbo1_AfterUpdate()
Me.cbo2 = Me.cbo1 * 10
End Sub

or

set the Control Source of cbo2 to

=[cbo2] * 10

and the value will change when you move off of the cbo1 textbox.

Just out of curiosity, why do you have textboxes named *** cbo *** ? cbo is
usually used as the prefix for a combobox. It works, of course, it's just
somewhat confusing!
 
G

George

Thanks Linq,

The problem is that I need to have the result in the second textbox by the
time I type a number on the first one and not after updating the first one.

Any ideas?

Ο χÏήστης "Linq Adams via AccessMonster.com" έγγÏαψε:
 

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

Similar Threads

Another combo box problem? 0
Refresh Form 1
Search form on a webpage 1
Header height by code 4
Count characters and play video 0
Subform Requery 1
Refresh versus Requery 2
Refresh, Requery, Repaint?? Which One? 2

Top