Check box saves the record and fires an update query

Pusher

BEOGRAD Put
Local time
Today, 14:18
Joined
May 25, 2011
Messages
230
Hi all,
I want to make a check box that saves the current record that is entered in the form. I want to make an update query that writes that current record in a different table so I want to make an OnClick event that fires that update query. Can someone help me?
Thanks
 
Why a checkbox? Why not a button?

Also, why are you duplicating data?
 
I already made 2 much changes in my relationships in my db, the easiest way of fixing the statistics problem is making a different table that will have that information. The update query is fired on the check box because that’s the check box that locks the record and then it can be entered in the new table.
 
I only save the record when i go to the next record, how do i save the record on a click (check box) so i can get this record in query that i can put in a different table. Also how do i chose the last record in a query as the only result. By Date? By unique key? What is the criteria?
 
By running an UPDATE query.

If you have a field that contains Date and Time, then you can use that field. If you have ann AutoNumber field or a field that increments for every new record, then you can use this field. DMax()
 
Thats a good idea, but how do i write the current form info into the table. I need the data that is currently in my form to be the result of my query...
 
In the UPDATE TO row of the UPDATE query put a full reference to the control, like this:
Code:
[Forms]![[COLOR=Red]FormName[/COLOR]]![[COLOR=Red]ControlName[/COLOR]]
 
I need the ENTER this into the table event or something, the form is for that table its not for this different new table. How do i enter the info from my form into the table with a click?
 
Last edited:
Like I mentioned, use an UPDATE query. The Table Source of the query will be the table you would like to update, then put the reference I gave you in my last post in the UPDATE TO field. Finally the WHERE clause will be a reference to the ID.
 
Using this rather strange method to save and write a Duplicate Record to another Table, you also need to think about how you're going to handle user errors, i.e. they tick the Checkbox, realize they've made a mistake, and untick it. You're now left with a Record in your 'statistics' Table that shouldn't be there!

As vbaInet has sort of hinted at, you're violating Normalization Rules here! "2 much changes" aside, you really should correct your problem now, instead of merely slapping a band aid on it. In following your current path, you are insuring that you're going to have a huge mess somewhere down the line, and the longer you put off fixing it, the bigger and more expensive the fix will be to implement.

Linq ;0)>
 

Users who are viewing this thread

Back
Top Bottom