Help with updating a table

  • Thread starter Thread starter ebragg
  • Start date Start date
E

ebragg

I have a data entry form for a table. On this form I have a text field that
does a calculation from a field that a user has entered data on. How can I
have the calculated field written to the table from this form?
 
You need to attach an event to the data entry field. The
simplest way to get this done is to use the AfterUpdate
event found under the control box's properties and the
event's tab. Select event procedure and click the button
at the end with the ellipsis (...). Then use the following:

Me.TargetTextField = Me.CalculatedTextField
DoCmd.RunCommand acCmdSaveRecord

Or get rid of the calculated text field and perform the
calculation in AccessVB:

Me.TargetTextField = Me.InputTextField*5+7...
 
You'll find fields in tables, controls are on forms and reports, etc.

In your table design, create a new field for your calculated value. Assure
you give it the correct type.

HTH
 
That did it
Thanks for your help!
kingston said:
You need to attach an event to the data entry field. The
simplest way to get this done is to use the AfterUpdate
event found under the control box's properties and the
event's tab. Select event procedure and click the button
at the end with the ellipsis (...). Then use the following:

Me.TargetTextField = Me.CalculatedTextField
DoCmd.RunCommand acCmdSaveRecord

Or get rid of the calculated text field and perform the
calculation in AccessVB:

Me.TargetTextField = Me.InputTextField*5+7...
 
Back
Top