Update table with data not in data input form

SwanseaAccess

New member
Local time
Today, 17:09
Joined
Sep 27, 2010
Messages
8
I'm using a form as a method for users to input data and I've programmed an add button so when it is clicked the data in the form is added to the table.

Is it possible to add data to the table without the user entering the data or it appearing on the form?

For example, I'd like to add data to my table for user name (whoever's logged in when the add button is pressed) and date of entry - both for audit purposes.

But also, I need to add some calculations based on data entered into the form. For example, user will enter prices in foreign currency but I want to have a field in my table for the GBP price (foreign price entered by user x exchange rate looked up in different table). I don't need this calculation in the form as it's unneccessary but I would like it in my table.

Thanks
 
I'm using a form as a method for users to input data and I've programmed an add button so when it is clicked the data in the form is added to the table.

Is it possible to add data to the table without the user entering the data or it appearing on the form?

For example, I'd like to add data to my table for user name (whoever's logged in when the add button is pressed) and date of entry - both for audit purposes.

But also, I need to add some calculations based on data entered into the form. For example, user will enter prices in foreign currency but I want to have a field in my table for the GBP price (foreign price entered by user x exchange rate looked up in different table). I don't need this calculation in the form as it's unneccessary but I would like it in my table.

Thanks

Look at this code as I am doing something similar

Dim db As DAO.Database
Dim rst As DAO.Recordset
Set db = CurrentDb
Set rst = db.OpenRecordset("tblHistoryDateSelected")
With rst

.AddNew
.Fields("FromDateSelected").Value = Me.txtStartDate.Value
.Fields("ToDateSelected").Value = Me.txtEndDate.Value
.Fields("Username").Value = Environ("UserName")
.Fields("DateSystemAdded").Value = Date
.Fields("Monies").value = me.txtCountryCurrency.value * me.txtExchange.value")
.Update


End With
 

Users who are viewing this thread

Back
Top Bottom