Append data from unbound fields (1 Viewer)

JPR

Registered User.
Local time
Today, 13:44
Joined
Jan 23, 2009
Messages
192
Hello friends,
I am having a bit of problem in trying to create an append query to store data from unbound textboxes to a table. I know that it's not the correct way to manage my db and will give you some quick info.
Once a week I get a txt file which I import in my table "Clients". During the week, data can change and want to store in a different table named "History" which gives me an historical record of all the new data. Obviously the following week, data in "clients" is update and this explains the reason of having an historical log.

I would like to append the new data that users will add in Tab New Data of form Clients to the table History, taking the FileNo as criteria. Once saved, the new data unbound textboxes, should be null ready for other data to be entered.
For your convenience, I have attached a simple examples db.
Thank you for any help.
 

Attachments

  • Test.zip
    46 KB · Views: 76

Ranman256

Well-known member
Local time
Today, 16:44
Joined
Apr 9, 2015
Messages
4,337
put in the full path for the update value,
update table set [status] = forms!myForm!txtBox
 

JPR

Registered User.
Local time
Today, 13:44
Joined
Jan 23, 2009
Messages
192
Thank you.
Sorry but where should I write it. Not very familiar with it. Should I create a query and how can I refer to the unbound fields?
 

Gasman

Enthusiastic Amateur
Local time
Today, 21:44
Joined
Sep 21, 2011
Messages
14,297
The easiest way for you would be to create a query qryAClientHistory in the QBR window and enter the form controls into the QBE columns.
The run that, the set the fields to "" with VBA.

So build the query, run it manually so you know it works.
Then write some VBA to run the query and a few lines to clear the controls.

I see you are using macros which will make it a little more cumbersome, but I believe you would use SetValue to clear the controls.

Use the Expression Builder to get everything correct.

HTH
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 04:44
Joined
May 7, 2009
Messages
19,242
here you may test.
 

Attachments

  • Test_4.zip
    50 KB · Views: 97

Users who are viewing this thread

Top Bottom