Me.Form.Refresh resets the form focus?

G

Guest

It seems that Me.Form.Refresh is resetting the current focus. Is there any
way to avoid this?

I have a form with fields that can be typed into, or calculated by typing
into other fields. If the user uses the calculator fields, to get the
calculated values to show up in the "outputs" I have to call form.refresh,
which resets the focus to my Save button. This is annoying because they're
typically typing into the fields and moving around using TAB, which gets
blown away.

Is there something other than refresh I could use instead? I tried just
removing them, but as I suspected this makes the changes not show up on the
screen, and worse, when you click in those fields you get an error saying
someone else changed the form (VERY annoying!).

Maury
 
U

UpRider

Maury after the refresh, you can move the focus anywhere you want:
txtMyField.setfocus

HTH, UpRider
 
D

Dirk Goldgar

In
Maury Markowitz said:
It seems that Me.Form.Refresh is resetting the current focus. Is
there any way to avoid this?

I have a form with fields that can be typed into, or calculated by
typing into other fields. If the user uses the calculator fields, to
get the calculated values to show up in the "outputs" I have to call
form.refresh, which resets the focus to my Save button. This is
annoying because they're typically typing into the fields and moving
around using TAB, which gets blown away.

Is there something other than refresh I could use instead? I tried
just removing them, but as I suspected this makes the changes not
show up on the screen, and worse, when you click in those fields you
get an error saying someone else changed the form (VERY annoying!).

If it's calculated controls you want to refresh, have you tried

Me.Recalc

? That won't work if the current, modified record has to be saved
before the values will be correct. But then you could say,

If Me.Dirty Then Me.Dirty = False
Me.Recalc
 
G

Guest

Dirk Goldgar said:
If it's calculated controls you want to refresh, have you tried

Me.Recalc

Ohhhh... I always though this was a shortform for me.form.refresh. I'm
reading between the lines, but I think this offers an obvious solution, I'll
write a sub that updates all of the interesting form fields in question.

Little late today, but I'll try this on Monday for sure.

Maury
 
G

Guest

Oppps... I noticed you said "Recalc" there, not "Refresh". No, the fields in
question are not calcs, all the calculation is done in a big chunk of VBA.

Maury
 

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