473,804 Members | 3,469 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I want to make a Controls Events Fire using code

For lack of the proper expression, how do I excite a control to cause
events to trigger.
I have a date control and am using a calender form button to fill the
text box with the date.
The text box is bound to a field. All this works great, but now the
date range validation is not
not working and the after update event that did calculations is not
working. This is without question the result of the control not
firing because I'm using code to make the entry. There must be a way
to make the control Dirty or whatever so that the events for the
control fire.

Any ideas?
Aug 11 '08 #1
8 2176

<co*****@gmail. comwrote in message
news:a4******** *************** ***********@p25 g2000hsf.google groups.com...
For lack of the proper expression, how do I excite a control to cause
events to trigger.
I have a date control and am using a calender form button to fill the
text box with the date.
The text box is bound to a field. All this works great, but now the
date range validation is not
not working and the after update event that did calculations is not
working. This is without question the result of the control not
firing because I'm using code to make the entry. There must be a way
to make the control Dirty or whatever so that the events for the
control fire.

Any ideas?
Validate the date before filling in the field?

Otherwise the event function is a sub routine that can be called.
Aug 11 '08 #2
"Greg (co*****@gmail. com)" <co*****@gmail. comwrote in
news:a400a6fb-ccbf-46b6-927a-
80**********@p2 5g2000hsf.googl egroups.co
m:
For lack of the proper expression, how do I excite a control to
cause events to trigger.
I have a date control and am using a calender form button to fill
the text box with the date.
The text box is bound to a field. All this works great, but now
the date range validation is not
not working and the after update event that did calculations is
not working. This is without question the result of the control
not firing because I'm using code to make the entry. There must be
a way to make the control Dirty or whatever so that the events for
the control fire.

Any ideas?
What you need to do is call the event procedure associated with the
event. Check out the Call statement in Help.

--
Bob Quintal

PA is y I've altered my email address.
** Posted from http://www.teranews.com **
Aug 11 '08 #3
Thanks Bob

But I don't think you call the Validation Event using code?
I guess it requires a workaround.

Greg
On Aug 11, 5:40*pm, Bob Quintal <rquin...@sPAmp atico.cawrote:
"Greg (code...@gmail. com)" <code...@gmail. comwrote in
news:a400a6fb-ccbf-46b6-927a-
805c62226...@p2 5g2000hsf.googl egroups.co
m:
For lack of the proper expression, how do I excite a control to
cause events to trigger.
I have a date control and am using a calender form button to fill
the text box with the date.
The text box is bound to a field. All this works great, but now
the date range validation is not
not working and the after update event that did calculations is
not working. *This is without question the result of the control
not firing because I'm using code to make the entry. There must be
a way to make the control Dirty or whatever so that the events for
the control fire.
Any ideas?

What you need to do is call the event procedure associated with the
event. Check out the Call statement in Help.

--
Bob Quintal

PA is y I've altered my email address.
** Posted fromhttp://www.teranews.co m**
Aug 12 '08 #4
"Greg (co*****@gmail. com)" <co*****@gmail. comwrote in news:ba9dc9ea-
be************* ************@k7 g2...le groups.com:
Thanks Bob

But I don't think you call the Validation Event using code?
I guess it requires a workaround.

Greg
I have no idea about what you mean in the phrase "Validation Event".
It's not an event associated with any Control, Form, Report or Query
that I've ever seen or heard of before.

The closest I can think of is the "Validation Rule" in the table
design, and that's not controllable via code.

If you mean "Validation Code", that can go into many events, depending
on WHAT is being validated. The control before and/or after_update
events and the Form's Before_Update are the usual places for this.

Please provide an explanation of WHAT you want to do, so we can tell
you the correct way to perform what you want to do. \That's what we're
here for.
>

On Aug 11, 5:40*pm, Bob Quintal <rquin...@sPAmp atico.cawrote:
>"Greg (code...@gmail. com)" <code...@gmail. comwrote in
news:a400a6f b-ccbf-46b6-927a-
805c62226...@p 25g2000hsf.goog legroups.co
m:
For lack of the proper expression, how do I excite a control to
cause events to trigger.
I have a date control and am using a calender form button to fill
the text box with the date.
The text box is bound to a field. All this works great, but now
the date range validation is not
not working and the after update event that did calculations is
not working. *This is without question the result of the control
not firing because I'm using code to make the entry. There must be
a way to make the control Dirty or whatever so that the events for
the control fire.
Any ideas?

What you need to do is call the event procedure associated with the
event. Check out the Call statement in Help.

--
Bob Quintal

PA is y I've altered my email address.
** Posted fromhttp://www.teranews.co m**



--
Bob Quintal

PA is y I've altered my email address.
** Posted from http://www.teranews.com **
Aug 12 '08 #5
Thanks Bob

My mistake. I didn't realize that the ValidationRule was not a
traditional event.
I'll have to experiment with code in the beforeupdate event to make
sure that the START date entered by my calender form button is <=
2000, and not greater that
the END date. And need to also excite the textbox using code, because
that does not take place now, and the entry goes unnoticed.

On Aug 12, 5:35*pm, Bob Quintal <rquin...@sPAmp atico.cawrote:
"Greg (code...@gmail. com)" <code...@gmail. comwrote in news:ba9dc9ea-
becf-4464-b7d4-726bec019...@k7 g2000hsd.google groups.com:
Thanks Bob
But I don't think you call the Validation Event using code?
I guess it requires a workaround.
Greg

I have no idea about what you mean in the phrase "Validation Event".
It's not an event associated with any Control, Form, Report or Query
that I've ever seen or heard of before.

The closest I can think of is the "Validation Rule" in the table
design, and that's not controllable via code.

If you mean "Validation Code", that can go into many events, depending
on WHAT is being validated. The control before and/or after_update
events and the Form's Before_Update are the usual places for this.

Please provide an explanation of WHAT you want to do, so we can tell
you the correct way to perform what you want to do. \That's what we're
here for.


On Aug 11, 5:40*pm, Bob Quintal <rquin...@sPAmp atico.cawrote:
"Greg (code...@gmail. com)" <code...@gmail. comwrote in
news:a400a6fb-ccbf-46b6-927a-
805c62226...@p2 5g2000hsf.googl egroups.co
m:
For lack of the proper expression, how do I excite a control to
cause events to trigger.
I have a date control and am using a calender form button to fill
the text box with the date.
The text box is bound to a field. All this works great, but now
the date range validation is not
not working and the after update event that did calculations is
not working. *This is without question the result of the control
not firing because I'm using code to make the entry. There must be
a way to make the control Dirty or whatever so that the events for
the control fire.
Any ideas?
What you need to do is call the event procedure associated with the
event. Check out the Call statement in Help.
--
Bob Quintal
PA is y I've altered my email address.
** Posted fromhttp://www.teranews.co m**

--
Bob Quintal

PA is y I've altered my email address.
** Posted fromhttp://www.teranews.co m**- Hide quoted text -

- Show quoted text -
Aug 13 '08 #6
"Greg (co*****@gmail. com)" <co*****@gmail. comwrote in
news:b5******** *************** ***********@a70 g2000hsh.google groups.co
m:
Thanks Bob

My mistake. I didn't realize that the ValidationRule was not a
traditional event.
The only thing that triggers the validation rule is writing the record
back to the table. That may be adequate, although it's often too late
in the data entry process to be user friendly..
--
Bob Quintal

PA is y I've altered my email address.
** Posted from http://www.teranews.com **
Aug 14 '08 #7
"Greg (co*****@gmail. com)" <co*****@gmail. comwrote in
news:b551597d-dcf8-4b93-a9b7-
bc**********@a7 0g2000hsh.googl egroups.co
m:
Thanks Bob

My mistake. I didn't realize that the ValidationRule was not a
traditional event.
I'll have to experiment with code in the beforeupdate event to
make sure that the START date entered by my calender form button
is <2000, and not greater that the END date. And need to also
excite the textbox using code, because that does not take place
now, and the entry goes unnoticed.
Put the code into the before update event.
In the code behind the calendar form's button,
call Forms!<<mainfor m>>!<<textbox>> _AfterUpdate.

You need to change that event's definition to public.
and the <<mainform>>, <<textbox>metav ariables to the real names.
Q
>

On Aug 12, 5:35*pm, Bob Quintal <rquin...@sPAmp atico.cawrote:
>"Greg (code...@gmail. com)" <code...@gmail. comwrote in
news:ba9dc9e a-
becf-4464-b7d4-726bec019...@k7 g2000hsd.google groups.com:
Thanks Bob
But I don't think you call the Validation Event using code?
I guess it requires a workaround.
Greg

I have no idea about what you mean in the phrase "Validation
Event". It's not an event associated with any Control, Form,
Report or Query that I've ever seen or heard of before.

The closest I can think of is the "Validation Rule" in the table
design, and that's not controllable via code.

If you mean "Validation Code", that can go into many events,
depending on WHAT is being validated. The control before and/or
after_update events and the Form's Before_Update are the usual
places for this.

Please provide an explanation of WHAT you want to do, so we can
tell you the correct way to perform what you want to do. \That's
what we're here for.


On Aug 11, 5:40*pm, Bob Quintal <rquin...@sPAmp atico.cawrote:
"Greg (code...@gmail. com)" <code...@gmail. comwrote in
news:a400a6f b-ccbf-46b6-927a-
805c62226...@p 25g2000hsf.goog legroups.co
m:
For lack of the proper expression, how do I excite a control
to cause events to trigger.
I have a date control and am using a calender form button to
fill the text box with the date.
The text box is bound to a field. All this works great, but
now the date range validation is not
not working and the after update event that did calculations
is not working. *This is without question the result of the
control not firing because I'm using code to make the entry.
There must be a way to make the control Dirty or whatever so
that the events for the control fire.
Any ideas?
>What you need to do is call the event procedure associated
with the event. Check out the Call statement in Help.
>--
Bob Quintal
>PA is y I've altered my email address.
** Posted fromhttp://www.teranews.co m**

--
Bob Quintal

PA is y I've altered my email address.
** Posted fromhttp://www.teranews.co m**- Hide quoted text -

- Show quoted text -



--
Bob Quintal

PA is y I've altered my email address.
** Posted from http://www.teranews.com **
Aug 14 '08 #8
<co*****@gmail. comwrote
My mistake. I didn't realize that the ValidationRule
was not a traditional event.
An Access Validation Rule is a Property, not an event. You can write
validation for the BeforeUpdate event of a Form, or the AfterUpdate event of
many Controls, if you want to performs some complex validation.
I'll have to experiment with code in the
beforeupdate event to make sure that the
START date entered by my calender form
button is <= 2000, and not greater that
the END date.
You press, or click, a Button Control, and you execute code or macros, but
values are going to come from some other source.
And need to also excite the textbox
using code, because that does not
take place now, and the entry goes
unnoticed.
"Excite" a text box? Do you perhaps mean "highlight" the textbox, for
example, by changing the backcolor or the text color? If you'll clarify, I
am sure someone can assist.

Larry Linson
Microsoft Office Access MVP
Aug 19 '08 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2146
by: MS Newsgroups | last post by:
Hi, I have a scenario where I am dynamically adding a control from code when a controls event is fired. The problem I have is that when the newly created control is clicked, the click event does not fire. I have written a simple demonstration that reproduces the problem and would appreciate if someone could give me a hint on how this should be done Many thanks Niclas
8
4318
by: Donald Xie | last post by:
Hi, I noticed an interesting effect when working with controls that are dynamically loaded. For instance, on a web form with a PlaceHolder control named ImageHolder, I dynamically add an image button at runtime: //----- Code snippet protected System.Web.UI.WebControls.PlaceHolder ImageHolder; private void Page_Load(object sender, System.EventArgs e)
2
2112
by: Tim Marsden | last post by:
Hi, This is what I am doing, please comment if this is the correct way. I need to add controls to a form dynamically. Within the Page_Load event (is not Postback) I run a routine to create the controls, and populate the dropdowns etc, I use addhandler to define delegates to capture events raised by the controls. I store these controls in a hashtable.
4
1592
by: JezB | last post by:
I am dynamically creating WebControls and creating them on my page. Some of these are buttons, and I attach events to these buttons. The problem is these force a post-back, so I must regenerate all the webcontrols in the same way (I am assuming - am I right?). It was all working fine but now I get the error: "An error has occurred because a control with auto-generated id '_ctl129' could not be located to raise a postback event. To...
1
1402
by: Paul | last post by:
An early Happy Thanksgiving to you and yours... We develop data driven apps. We dynamically place controls on a panel which may be then be placed on a web form or another control. My problem is that I can't get the events of the hosted controls to fire. e.g. ' myUserControl.ascx. is placed on myWebForm.aspx in the Designer ' myUserControl.ascx has a Panel on it, Panel1 ' From code in myUserControl.ascx I pass Panel1 ByRef to a class...
4
1440
by: Lenster | last post by:
Hi I'm using bound controls on a windows form such as textboxes, checkboxes etc. which work fine except for one thing... If you click on a checkbox for example its value changes visibly and also the value changes in the underlying data table - but no events are fired until you move to a new column or row. Does anyone know of a way of being notified when the fields value starts
5
1848
by: Fred | last post by:
hi, i have a page written by someone else w/ a few user controls inside it(w/ user controls inside em too) - what i dont get is the order different page_inits, page_loads, cashed and postback events and code inside <% %> are executing can u plz point me to a specification or some other description of the whole process TIA
0
1100
by: Steve Moreno | last post by:
Hi all, I've got a web form that I've written code to create an array of DropDownList controls on the page depending on how many records are pulled back. The code to create the controls is working fine but now I need to add events to the newly created DropDownList controls. I need to add the SelectedIndexChanged event and I'm having a hard time getting the code to add events to the controls since the names (IDs) are varied to include...
5
2726
by: Steve Moreno | last post by:
Hi all, I've got a web form that I've written code to create an array of DropDownList controls on the page depending on how many records are pulled back. The code to create the controls is working fine but now I need to add events to the newly created DropDownList controls. I need to add the SelectedIndexChanged event and I'm having a hard time getting the code to add events to the controls since the names (IDs) are varied to include...
0
9588
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10327
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10085
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9161
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7625
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6857
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5663
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4302
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3828
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.