On Click

  • Thread starter Thread starter Claire
  • Start date Start date
C

Claire

ALSO POSTED ON:microsoft.public.access.forms

Good Day

I need to know how to imitate an OnClick event without the
user actually having to click in the control.

My form list box returns yes or no to show whether or not
an account is tax exempt. However, my tax calculation
control will not recalculate and show the correct result
of it's IIF statement until I actually click in the exempt
testing control, in fact it holds on to the result from
whichever record I looked at previously.

I think what might be messing this all up is the fact that
these controls are both on a tab control page and the
underlying main form is not tied to a specific table or
query.

Any suggestions?

TIA
Claire
 
Hi Claire

You can call an event procedure just like you can call any other procedure
in VBA:
Call cmdMyButton_Click

You might call this from the AfterUpdate event of your listbox, or from the
Form_Current event procedure, or both.

The tab control won't make any difference at all.

BTW, please don't send the same message independently to multiple
newsgroups. This is called "multiposting". Instead, if it's appropriate,
specify multiple destination newsgroups and send it only once. (This is
"cross-posting".) That way, any replies in one group will be visible in all
groups.
 
Claire said:
ALSO POSTED ON:microsoft.public.access.forms

Good Day

I need to know how to imitate an OnClick event without the
user actually having to click in the control.

My form list box returns yes or no to show whether or not
an account is tax exempt. However, my tax calculation
control will not recalculate and show the correct result
of it's IIF statement until I actually click in the exempt
testing control, in fact it holds on to the result from
whichever record I looked at previously.

I think what might be messing this all up is the fact that
these controls are both on a tab control page and the
underlying main form is not tied to a specific table or
query.

Any suggestions?

TIA
Claire

Do I understand correctly that your problem is with a control whose
value is calculated by code in a Click event? You can call the Click
event procedure directly from some other event procedure; for example,
from the AfterUpdate event of some other control. So long as both
procedures are defined in the same form module, there's nothing special
you have to do. So you can have code along these lines:

Private Sub chkTaxExempt_AfterUpdate()

Call txtTaxAmount_Click

End Sub

However, I can't tell from your description whether your situation is
more complicated than this. If this isn't enough for you to go on,
you'll need to give more details about controls, controlsources, the
form's recordsource, and existing code.
 
Awesome, thanks for the info guys...I need to take a VB
course......

I did try cross-posting but I received an error. I
separated the two newsgroups by a semi-colon.
microsoft.public.access.formscoding;microsoft.public.access
..forms

How should I have done it??

Thanks
-----Original Message-----
Hi Claire

You can call an event procedure just like you can call any other procedure
in VBA:
Call cmdMyButton_Click

You might call this from the AfterUpdate event of your listbox, or from the
Form_Current event procedure, or both.

The tab control won't make any difference at all.

BTW, please don't send the same message independently to multiple
newsgroups. This is called "multiposting". Instead, if it's appropriate,
specify multiple destination newsgroups and send it only once. (This is
"cross-posting".) That way, any replies in one group will be visible in all
groups.

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

ALSO POSTED ON:microsoft.public.access.forms

Good Day

I need to know how to imitate an OnClick event without the
user actually having to click in the control.

My form list box returns yes or no to show whether or not
an account is tax exempt. However, my tax calculation
control will not recalculate and show the correct result
of it's IIF statement until I actually click in the exempt
testing control, in fact it holds on to the result from
whichever record I looked at previously.

I think what might be messing this all up is the fact that
these controls are both on a tab control page and the
underlying main form is not tied to a specific table or
query.

Any suggestions?

TIA
Claire


.
 
Claire said:
Awesome, thanks for the info guys...I need to take a VB
course......

You're welcome.
I did try cross-posting but I received an error. I
separated the two newsgroups by a semi-colon.
microsoft.public.access.formscoding;microsoft.public.access
.forms

How should I have done it??

I'm not very familiar with the web interface, as I use Outlook Express
to read and post news instead. Did you try separating them with a
comma?
 
Back
Top