Return Value to Control on Current Record

G

Guest

Hello,
I have some code written for a combo box On Change event on a form. I would
like to have the result of that code returned to a control on the current
record (the one that triggered the On Change event).

Here are the last two lines of my code:
Me.txtTest.SetFocus
Me.txtTest.Text = MinPeriod

The problem with this is it updates the txtTest control value on ALL the
records, not just the current one. Any suggestions?
 
M

Marshall Barton

CSSMepps said:
I have some code written for a combo box On Change event on a form. I would
like to have the result of that code returned to a control on the current
record (the one that triggered the On Change event).

Here are the last two lines of my code:
Me.txtTest.SetFocus
Me.txtTest.Text = MinPeriod

The problem with this is it updates the txtTest control value on ALL the
records, not just the current one.


Without significantly more justification for that approach,
I have to say that you are on the wrong track. The Change
event and Text property are only useful for analyzing the
combo box's entry before the user has completed the entry.

I suspect that you should be using the combo box's
AfterUpdate event and the Value property, no SetFocus
needed.
Me.txtTest = MinPeriod

But, unless the txtText text box is bound to a field in the
form's record source table query, it only has one value to
display so it has to be the same for all rows.
 

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