By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,660 Members | 1,735 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,660 IT Pros & Developers. It's quick & easy.

after update not triggered

P: n/a
I'm trying to use a "keypad" form (with command buttons for numbers 0
thru 9) I developed to allow users to first click a textbox on one
form, then click a number on the keypad and have the value entered in
the textbox. It's all seemingly working except that I have an
AfterUpdate event set for the textboxes and that event is NOT triggered
when I use the keypad to enter data. If I enter numbers with the
regular keyboard, the even is triggered. What's the difference between
values entered via the virtual keypad vs. the real keyboard? Why would
using the keypad not precipitate the AfterUpdate event?

Just for yucks, here's some of the code in the "keypad" form:

Private Function f_NumberClick(sValue As String)

'MsgBox Forms(sPrevious).ActiveControl.Form.ActiveControl. Name
If Forms(sPrevious).ActiveControl.ControlType = acSubform Then
Forms(sPrevious).ActiveControl.Form.ActiveControl =
Forms(sPrevious).ActiveControl.Form.ActiveControl & sValue
'[Form_frm_plot_species_compNonVasc_FD].ActiveControl =
[Form_frm_plot_species_compNonVasc_FD].ActiveControl & sValue
'Forms(sPrevious).ActiveControl.Form.Refresh
'Forms(sPrevious).ActiveControl.Form.Requery
Else
Forms(sPrevious).ActiveControl = Forms(sPrevious).ActiveControl &
sValue
'[Form_frm_plot_species_compNonVasc_FD].ActiveControl =
[Form_frm_plot_species_compNonVasc_FD].ActiveControl & sValue
'Forms(sPrevious).ActiveControl.Parent.Refresh
'Forms(sPrevious).ActiveControl.Parent.Requery
End If
Forms(sPrevious).Refresh
Forms(sPrevious).Requery
==============================================
The sPrevious variable (name of the target form) is passed to the
"keypad" form when it is opened from a button on the form with the
textboxes that will be taking the data. Each numbered command button on
the keypad form simply calls the above function and passes it's value.
The above function is designed to work on subforms too.

Thanks for any help.

Doug
Fairbanks, AK

Dec 21 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
On 21 Dec 2005 15:17:44 -0800, "Dugo" <Do*********@nps.gov> wrote:
I'm trying to use a "keypad" form (with command buttons for numbers 0
thru 9) I developed to allow users to first click a textbox on one
form, then click a number on the keypad and have the value entered in
the textbox. It's all seemingly working except that I have an
AfterUpdate event set for the textboxes and that event is NOT triggered
when I use the keypad to enter data. If I enter numbers with the
regular keyboard, the even is triggered. What's the difference between
values entered via the virtual keypad vs. the real keyboard? Why would
using the keypad not precipitate the AfterUpdate event?


You can add a line to your procedure which invokes the after update
event yourself, can't you?

mike
Dec 22 '05 #2

P: n/a
Dugo wrote in message
<11**********************@z14g2000cwz.googlegroups .com> :
I'm trying to use a "keypad" form (with command buttons for numbers 0
thru 9) I developed to allow users to first click a textbox on one
form, then click a number on the keypad and have the value entered in
the textbox. It's all seemingly working except that I have an
AfterUpdate event set for the textboxes and that event is NOT triggered
when I use the keypad to enter data. If I enter numbers with the
regular keyboard, the even is triggered. What's the difference between
values entered via the virtual keypad vs. the real keyboard? Why would
using the keypad not precipitate the AfterUpdate event?

Just for yucks, here's some of the code in the "keypad" form:

Private Function f_NumberClick(sValue As String)

'MsgBox Forms(sPrevious).ActiveControl.Form.ActiveControl. Name
If Forms(sPrevious).ActiveControl.ControlType = acSubform Then
Forms(sPrevious).ActiveControl.Form.ActiveControl =
Forms(sPrevious).ActiveControl.Form.ActiveControl & sValue
'[Form_frm_plot_species_compNonVasc_FD].ActiveControl =
[Form_frm_plot_species_compNonVasc_FD].ActiveControl & sValue
'Forms(sPrevious).ActiveControl.Form.Refresh
'Forms(sPrevious).ActiveControl.Form.Requery
Else
Forms(sPrevious).ActiveControl = Forms(sPrevious).ActiveControl &
sValue
'[Form_frm_plot_species_compNonVasc_FD].ActiveControl =
[Form_frm_plot_species_compNonVasc_FD].ActiveControl & sValue
'Forms(sPrevious).ActiveControl.Parent.Refresh
'Forms(sPrevious).ActiveControl.Parent.Requery
End If
Forms(sPrevious).Refresh
Forms(sPrevious).Requery
==============================================
The sPrevious variable (name of the target form) is passed to the
"keypad" form when it is opened from a button on the form with the
textboxes that will be taking the data. Each numbered command button on
the keypad form simply calls the above function and passes it's value.
The above function is designed to work on subforms too.

Thanks for any help.

Doug
Fairbanks, AK


I think the after update event of controls only fire after "manually"
entering the value, as you've found. I think you can either

- fire of the After update event through calling it in code in your
virtual keyboard code
- setting focus to a control, and using assigning to it's .Text
property
in stead of the default .Value property, I think might fire the After
update event of it

--
Roy-Vidar

Dec 22 '05 #3

P: n/a
Thanks. I simply changed it to use .Text and it's now working. But I've
caused myself a new, related problem. Each time a button on the virtual
keypad is clicked, it updates the .Text of the target control and fires
off the afterupdate event is triggered. But if you want to use more
than one number from the keypad, for example enter "25", the
afterupdate is triggered on the "2" and the "5" but I want it to
trigger only once (since "25" is the complete value for that textbox).

So I've gone from having no afterupdate triggers to too many of them.
How do I have it trigger afterupdate only when the user is done
entering data?

Thanks again,
Doug

Dec 22 '05 #4

P: n/a
Dugo wrote in message
<11**********************@g14g2000cwa.googlegroups .com> :
Thanks. I simply changed it to use .Text and it's now working. But I've
caused myself a new, related problem. Each time a button on the virtual
keypad is clicked, it updates the .Text of the target control and fires
off the afterupdate event is triggered. But if you want to use more
than one number from the keypad, for example enter "25", the
afterupdate is triggered on the "2" and the "5" but I want it to
trigger only once (since "25" is the complete value for that textbox).

So I've gone from having no afterupdate triggers to too many of them.
How do I have it trigger afterupdate only when the user is done
entering data?

Thanks again,
Doug


Ah, that's probably out of my league, I'm afraid.

Just thinking, don't know if it's any help at all, but what you
probably need,
is to find events/actions that mimick the keystrokes that triggers the
after
update from the keyboard (like Enter or Tab, for instance), then use
those to
call your code.

--
Roy-Vidar

Dec 22 '05 #5

P: n/a
Or have the keypad first put the value the user wants in the textbox
into a control on the keypad form and then have a button on the keypad
to "assign" or "insert" that value into the textbox. But that's one
more step I'd like to avoid if possible.

Dec 22 '05 #6

P: n/a
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

You should be using the OnChange event, not the AfterUpdate event to add
new characters to the other control.

OnChange occurs when the user types something into the Control.

AfterUpdate occurs when the user exits the control.
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQ7HBx4echKqOuFEgEQLOVwCgjuDTSOSSXJxP/Nv/f+5nkUUIllcAn2t2
SY+i1SW24aoHEwzNTqNd2S5l
=kurp
-----END PGP SIGNATURE-----

Dugo wrote:
I'm trying to use a "keypad" form (with command buttons for numbers 0
thru 9) I developed to allow users to first click a textbox on one
form, then click a number on the keypad and have the value entered in
the textbox. It's all seemingly working except that I have an
AfterUpdate event set for the textboxes and that event is NOT triggered
when I use the keypad to enter data. If I enter numbers with the
regular keyboard, the even is triggered. What's the difference between
values entered via the virtual keypad vs. the real keyboard? Why would
using the keypad not precipitate the AfterUpdate event?

Just for yucks, here's some of the code in the "keypad" form:

Private Function f_NumberClick(sValue As String)

'MsgBox Forms(sPrevious).ActiveControl.Form.ActiveControl. Name
If Forms(sPrevious).ActiveControl.ControlType = acSubform Then
Forms(sPrevious).ActiveControl.Form.ActiveControl =
Forms(sPrevious).ActiveControl.Form.ActiveControl & sValue
'[Form_frm_plot_species_compNonVasc_FD].ActiveControl =
[Form_frm_plot_species_compNonVasc_FD].ActiveControl & sValue
'Forms(sPrevious).ActiveControl.Form.Refresh
'Forms(sPrevious).ActiveControl.Form.Requery
Else
Forms(sPrevious).ActiveControl = Forms(sPrevious).ActiveControl &
sValue
'[Form_frm_plot_species_compNonVasc_FD].ActiveControl =
[Form_frm_plot_species_compNonVasc_FD].ActiveControl & sValue
'Forms(sPrevious).ActiveControl.Parent.Refresh
'Forms(sPrevious).ActiveControl.Parent.Requery
End If
Forms(sPrevious).Refresh
Forms(sPrevious).Requery
==============================================
The sPrevious variable (name of the target form) is passed to the
"keypad" form when it is opened from a button on the form with the
textboxes that will be taking the data. Each numbered command button on
the keypad form simply calls the above function and passes it's value.
The above function is designed to work on subforms too.

Thanks for any help.

Doug
Fairbanks, AK

Dec 27 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.