Update multiple records with value from inputbox

spudracer

Here and there
Local time
Today, 02:43
Joined
Jul 1, 2008
Messages
199
Instead of using an update query, so my Audit Trail will continue to update correctly, I'd like to use an input box and run a function that performs much like an update query.

My problem is, only one out of 4 records updates correctly.

Code:
Me.txtTranTo = InputBox("Enter Location Transferring To:", "Location Transferring To", "")
Me.txtTranFrom.Value = Me.Location 'Old location
Me.Location.Value = Me.txtTranTo 'New location

The txtTranTo and txtTranFrom are unbound text boxes.

EDIT: Forgot to mention that this is in a continuous form.
 
Last edited:
Instead of using an update query, so my Audit Trail will continue to update correctly, I'd like to use an input box and run a function that performs much like an update query.
Why?
I can't see the benefit of making code when you can do it in one go!
My problem is, only one out of 4 records updates correctly.
..

EDIT: Forgot to mention that this is in a continuous form.
Then you need to write some code, (a loop), so all records update and not only the first one, (use a RecordsetClone).
Here is a link to it. http://msdn.microsoft.com/en-us/library/office/ff835062(v=office.15).aspx
 
Last edited:

Users who are viewing this thread

Back
Top Bottom