YousifKI
YousifKI

Reputation: 21

Change default value of textbox to last value entered

I have a FORM (frm_Amounts) based on a TABLE (tbl_Amounts), containing three Text Boxes,

The first Text Box is (Amount_EUR) based on field value in [tbl_Amounts].
The second Text Box is (ExchangeRate). Its value is entered in the FORM.
The third Text Box is (Amount_US$). Its value is calculated by: [Amount_EUR] * [ExchangeRate]

Initially I will enter a value for [ExchangeRate]. I want that value to become the default value until I enter a new value for [ExchangeRate].
This new value will continue as the default until I change it, and so on.
When I close the Access database and reopen, I want the last value entered in [ExchangeRate] to be the default value for the [ExchangeRate] Text Box.

Upvotes: 1

Views: 343

Answers (1)

June7
June7

Reputation: 21370

Use the AfterUpdate event of [ExchangeRate] textbox to set its DefaultValue property with value just entered. Subsequent new records will have that value until a new input or the form is closed. Changing Textbox.DefaultValue in Access

When opening form, if you want to retrieve the last value entered, that will require either saving that value into a special table for that purpose or doing a search of the actual data table to pull that value.

Upvotes: 1

Related Questions