473,394 Members | 1,956 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How to copy field information from deleted records selected in datasheet view

I am trying to keep a log of records that I have deleted. I am trying to find a way to create an array of "CustomerID "(autonumber field) that stores information of the records selected when I hit the delete button. To further complicate the process the CustomerID number is part of the record source but is not on the form. Any suggestions would be appreciated.
Apr 14 '11 #1
8 1829
TheSmileyCoder
2,322 Expert Mod 2GB
This doesn't exactly answer your question but I thought I would just say how I handle deletions. I simply have a field in my database bDeleted, which defaults to false. Whenever I "delete" a record, I simply switch the boolean to True, and of course my queries all run filtering out the "deleted" records. This gives me the advantage of never really deleting the records, should I ever need to retrieve them (which happens).
Apr 14 '11 #2
Thanks for the response. I may use that for some tables. But I import a lot of data into the pricing records to merge then I delete it when I am done. So this could leave a lot of extra data which is probably not a good idea.
Apr 14 '11 #3
This makes sense to me when deleting one record but how do you handle multiple records being deleted at the same time?
Apr 15 '11 #4
TheSmileyCoder
2,322 Expert Mod 2GB
You simply run an update query instead of a delete query. Another option is to transfer the records out of the main table and into a table of deleted records.

If you want progress on your original question I will need more information on exactly what information you wish to store and where.
Apr 15 '11 #5
I am not running a delete query. I am selecting specific records in the datasheet view to delete and then clicking the delete record button on the toolbar. I do not want to transfer records in a table of deleted records as I have one table that logs all of the table ID numbers but it is not set to hold other field information. I guess my main question is to find a way to create an array of field ID values based on the records selected in a datasheet view when clicking the delete record button.
Apr 15 '11 #6
TheSmileyCoder
2,322 Expert Mod 2GB
If your doing your deletion from a form, in datasheet view mode, you can tie code to the deletion event, in which you add the ID of the deleted record to "somewhere". I dont think you can store it as an array, but you could store it as a comma-seperated string in a memo field, or as suggested earlier, have the delete event, make a copy of the record to a secondary file, and even do such things as register who deleted it and when.
Apr 15 '11 #7
Yes, I agree I can tie it to the delete event (that is what I have done so far) which would be fine if I was only deleting one record but the issue I have is deleting multiple records at the same time and logging this information
Apr 15 '11 #8
TheSmileyCoder
2,322 Expert Mod 2GB
I see. As you can see from my posts I dont actually use hard deletion much. I just assumed that if you deleted multiple records, the delete event would run for each individual record.
Apr 15 '11 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: deko | last post by:
I have a form with a subform datasheet - I need code behind the OnDelete event of the subform: Private Sub Form_Delete(Cancel As Integer) 'do something that depends on which record is deleted...
1
by: Yuki | last post by:
I am trying to find out if I can have a specific record that has been selected in a list box be opened in datasheet view. I can't seem to find where this can happen or what I need to use to make...
1
by: drhoo | last post by:
Hi, I think the answer is "No", but I thought I'd better ask before I rule it out. With a form in datasheet view, is there any way to capture programatically the selected (i.e. with...
1
by: KC | last post by:
I am using Access 2002, with a database template from MS Office. The Orders Management Database. I have tweaked this for use with our company. It is a small database with close to a 1000 records...
0
by: ET | last post by:
We have two tables... one with primary key ID and second table with secondary key to the ID in the first table... Now, they query pulls records from both tables, looks like this: SELECT...
7
by: Ken Mylar | last post by:
First a quick background on the form: I have a form that is normally viewed in Single form mode. It has a subform on it that is in datasheet view. The main form is for work orders and the...
5
by: Kaur | last post by:
Hi, I have been successful copying a vba code from one of your posts on how to copy and paste a record by declaring the desired fields that needs to be copied in form's declaration and creating two...
2
by: Takeadoe | last post by:
Dear NG - I may be nuts, so forgive me for bothering you. There is a text variable in my table that shows up in design view, but is no where to be found in the datasheet view. The field should be...
16
by: ulam | last post by:
I have a form shown in datasheet view, and I have some actions that require that form to be requeried with a delete operation, however number of rows in the datasheet view remains constant with a...
2
by: zandiT | last post by:
hello i have an access database which ive just put on a shared folder on the network for users to use. i tested it well, exported all the objects in a new database, converted to to an mde file,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.