Calculated Field in a Form Problem

Sirkevin

Registered User.
Local time
Today, 15:09
Joined
Oct 22, 2008
Messages
16
I have a similar problem to a couple of other threads I have found, however I do not seem to be able to find a solution.

There is a combo box in the form header which brings up the corresponding record in the detail.

I then have a text box (lets call it text box 1) which pulls through a column from a combo box in the record that has been returned (lets call this Combo 1). This works on an after update event.

I then have a text box in the form (text box 2) that uses the pulled value from text box 1 to run a calculated value.

The problem I have is that text box 1 is only filled on an after update event, i.e. if I change Combo 1's value. This therefore means no calculation is run is text box 2.

How can I amend this process so that text box 1 is filled as soon as the record is returned (from the selection in the header).

Please bear in mind I am not an expert in Access.

Thanks guys!!
 
When calculations are done via the AfterUpdate event of a field, in order for these to persist, which is to say for them to repeat when you go back to a record later, you have to include the calculation in the Form_Current event as well:

Code:
Private Sub Form_Current()
 If Not Me.NewRecord Then
   'Repeat your calculations here
 End If
End Sub
 
Works great thanks.

icon7.gif
 

Users who are viewing this thread

Back
Top Bottom