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

I want to make a Controls Events Fire using code

P: n/a
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
Share this Question
Share on Google+
8 Replies


P: n/a

<co*****@gmail.comwrote in message
news:a4**********************************@p25g2000 hsf.googlegroups.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

P: n/a
"Greg (co*****@gmail.com)" <co*****@gmail.comwrote in
news:a400a6fb-ccbf-46b6-927a-
80**********@p25g2000hsf.googlegroups.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

P: n/a
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...@sPAmpatico.cawrote:
"Greg (code...@gmail.com)" <code...@gmail.comwrote in
news:a400a6fb-ccbf-46b6-927a-
805c62226...@p25g2000hsf.googlegroups.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.com**
Aug 12 '08 #4

P: n/a
"Greg (co*****@gmail.com)" <co*****@gmail.comwrote in news:ba9dc9ea-
be*************************@k7g2000h...legroup s.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...@sPAmpatico.cawrote:
>"Greg (code...@gmail.com)" <code...@gmail.comwrote in
news:a400a6fb-ccbf-46b6-927a-
805c62226...@p25g2000hsf.googlegroups.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.com**



--
Bob Quintal

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

P: n/a
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...@sPAmpatico.cawrote:
"Greg (code...@gmail.com)" <code...@gmail.comwrote in news:ba9dc9ea-
becf-4464-b7d4-726bec019...@k7g2000hsd.googlegroups.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...@sPAmpatico.cawrote:
"Greg (code...@gmail.com)" <code...@gmail.comwrote in
news:a400a6fb-ccbf-46b6-927a-
805c62226...@p25g2000hsf.googlegroups.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.com**

--
Bob Quintal

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

- Show quoted text -
Aug 13 '08 #6

P: n/a
"Greg (co*****@gmail.com)" <co*****@gmail.comwrote in
news:b5**********************************@a70g2000 hsh.googlegroups.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

P: n/a
"Greg (co*****@gmail.com)" <co*****@gmail.comwrote in
news:b551597d-dcf8-4b93-a9b7-
bc**********@a70g2000hsh.googlegroups.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!<<mainform>>!<<textbox>>_AfterUpdate.

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

On Aug 12, 5:35*pm, Bob Quintal <rquin...@sPAmpatico.cawrote:
>"Greg (code...@gmail.com)" <code...@gmail.comwrote in
news:ba9dc9ea-
becf-4464-b7d4-726bec019...@k7g2000hsd.googlegroups.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...@sPAmpatico.cawrote:
"Greg (code...@gmail.com)" <code...@gmail.comwrote in
news:a400a6fb-ccbf-46b6-927a-
805c62226...@p25g2000hsf.googlegroups.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.com**

--
Bob Quintal

PA is y I've altered my email address.
** Posted fromhttp://www.teranews.com**- 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

P: n/a
<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 discussion thread is closed

Replies have been disabled for this discussion.