textbox event

J

John

I have a main form with a tabcontrol on it. The first tab contains
fields that are part of the main table. The second tab has a subform
on it. On the subform there is a subtotal textbox totalling up the
currency in the subform. This amt is then brought to the main form
(first tab) by using a textbox with a control source of the subforms
textbox. What the users want (and are very adamant about it) is the
mainform textbox on the first tab are to have a series of events
occur;
1) a check to see if the amt is over the user authority level (2, 3,
4 are dependent on if over limit)
2) a "watermark" (actually a label) appears saying above authority
level
3) some controls are disabled
4) several controls are enabled

I have tried using the textbox BeforeUpdate, AfterUpdate, _Changed,
and Form_Current, and even tried using the subforms textbox but it
seems I am striking out on everything. What is the best textbox event
that will work all this (or least #1)?

Thanks...John
 
B

Bob Quintal

:
I have a main form with a tabcontrol on it. The first tab
contains fields that are part of the main table. The second tab
has a subform on it. On the subform there is a subtotal textbox
totalling up the currency in the subform. This amt is then
brought to the main form (first tab) by using a textbox with a
control source of the subforms textbox. What the users want (and
are very adamant about it) is the mainform textbox on the first
tab are to have a series of events occur;
1) a check to see if the amt is over the user authority level (2,
3, 4 are dependent on if over limit)
2) a "watermark" (actually a label) appears saying above
authority level
3) some controls are disabled
4) several controls are enabled

I have tried using the textbox BeforeUpdate, AfterUpdate,
_Changed, and Form_Current, and even tried using the subforms
textbox but it seems I am striking out on everything. What is the
best textbox event that will work all this (or least #1)?

Thanks...John

Textbox events only fire when the user manually edits the contents of
the control, so they will be of no use in your situation.

The Form_Current event should trigger if the value is above limit
when the form opens or you move to the new record.

If the users are editing the subform and want to see the change
immediately, use the subform's after update event.

Hint: if you need to trigger the events from both places, put the
code in a separate procedure in the form's module and simply put the
statement'call me.my_procedure()' or 'call parent.my_procedure()'
(without quotes), where needed
 
J

John

:








Textbox events only fire when the user manually edits the contents of
the control, so they will be of no use in your situation.

The Form_Current event should trigger if the value is above limit
when the form opens or you move to the new record.

If the users are editing the subform and want to see the change
immediately, use the subform's after update event.

Hint: if you need to trigger the events from both places, put the
code in a separate procedure in the form's module and simply put the
statement'call me.my_procedure()' or 'call parent.my_procedure()'
(without quotes), where needed    

--
Bob Q.
PA is y I've altered my address.- Hide quoted text -

- Show quoted text -



Thanks for the info. I will see about your suggestions. I still
don't know why the Submit button I originally had the events tied to
wouldn't suffice, but I guess they know what they want.
....John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top