Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 1 / December 2005

Tip: Looking for answers? Try searching our database.

after update not triggered

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dugo - 21 Dec 2005 23:17 GMT
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
Mike Preston - 22 Dec 2005 07:49 GMT
>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
[quoted text clipped - 5 lines]
>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
RoyVidar - 22 Dec 2005 12:16 GMT
Dugo wrote in message
<1135207064.598374.151750@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
[quoted text clipped - 39 lines]
> 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

Signature

Roy-Vidar

Dugo - 22 Dec 2005 17:52 GMT
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
RoyVidar - 22 Dec 2005 19:25 GMT
Dugo wrote in message
<1135273928.458100.312600@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
[quoted text clipped - 10 lines]
> 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.

Signature

Roy-Vidar

Dugo - 22 Dec 2005 19:36 GMT
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.
MGFoster - 27 Dec 2005 22:35 GMT
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.
Signature

MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

> 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
[quoted text clipped - 39 lines]
> Doug
> Fairbanks, AK
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.