Use "after update" to open form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have an unbound text box to calculate the total hours. When the total is
greater than 36 I would like to open a new form for that record.

In the "after update" event I have the following code:

If Me.HrsSum > 36 Then DoCmd.OpenForm "Comment", , , "RecordID = " &
Me.RecordID & ""

yet nothing happens.

Cheers!
 
The after update event only happens when you update the control, not when
code does. What you can do is to add your code to the after update event of
the controls which contribute to the calculated control.
 
If the ControlSource of your unbound text box is your formula then *no*
AfterUpdate event is generated. That event is only generated when there is
user input to a control.
 
How are you triggering the calculation?
If the ControlSource of your unbound text box is your formula then *no*
AfterUpdate event is generated. That event is only generated when there is
user input to a control.
[quoted text clipped - 9 lines]
 
thanks for the heads up!




ruralguy via AccessMonster.com said:
If the ControlSource of your unbound text box is your formula then *no*
AfterUpdate event is generated. That event is only generated when there is
user input to a control.
 
If the Control Source of the text box is an expression (formula), you don't
have access to the actual value resulting from the expression. You'll need
to perform the same calculation again in your code to get the value.

Carl Rapson
 
The following in the control source

=[HrsWrk_basic]+[HrsWrk_ID1]+[HrsWrk_ID2]+[HrsWrk_ID3]
 
For each of the three controls which make up the calculation I have inserted
the code. The code works but I need to refresh the record before the
"comments" form opens so other information from the record is shown.

How can I do this?
 
What it is this group, and why is it appearing on my computer?

Yvonne Michele Anderson
(e-mail address removed)
 

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

Back
Top