Results 1 to 11 of 11
  1. #1
    cooglerj is offline Novice
    Windows XP Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    25

    Command to delete eveything in a record besides 3 things


    Hi, Im wanting to delete everthing in a record in the table tbl_m16a4_rco by using form frm_m16a4_rco_deissue. Everything needs to be deleted besides rack# ,rifle serial number, and rco serial number. What would be the best way to do this? any help is appreciated. WEAPONSDATABASE.zip

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    There is no form by that name.

    You can manually delete the data from each control.

    If you want to run code:

    Me!Last = Null
    Me!First = Null
    etc.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    cooglerj is offline Novice
    Windows XP Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    25
    WEAPONSDATABASEAMT.zip Sorry here it is. Exactly where would I put the code? Sorry im an access newb

  4. #4
    cooglerj is offline Novice
    Windows XP Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    25
    What im wanting to do is select that row and hit a button and it deleted the fields I wanna delete.

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Do you want to delete the data or delete the fields from table?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    cooglerj is offline Novice
    Windows XP Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    25
    Sorry the data in that record selected

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    The code needs to go in some event - button Click or form BeforeUpdate, etc.

    The real trick with coding is figuring out what event to use.

    Why are you saving all that marine info into every table? I presume each marine can have multiple equipment (pistols, rifles). Should have a table of Marines and then just save their ID into each of the equipment tables. Then the only data that has to be removed is the ID.

    Maybe these tutorials will help you better understand relational database design http://www.rogersaccesslibrary.com/
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  8. #8
    cooglerj is offline Novice
    Windows XP Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    25
    Because thats the only way I knew how to do it. Could you give me an example of what code I would use for that table? Thanks for the input btw.

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Why would you need code to create a table?

    A database can actually be built to function without a scrap of code. It would be a very simple db but it can be done.

    But before even thinking about user interface, need to get the data structure correct. Identify the data entities and how they relate. Have you studied the referenced link or any other tutorials on relational database principles? Until you have a grasp of those principles, your db development experience will be constant frustration.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  10. #10
    cooglerj is offline Novice
    Windows XP Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    25
    Quote Originally Posted by June7 View Post
    Why would you need code to create a table?

    A database can actually be built to function without a scrap of code. It would be a very simple db but it can be done.

    But before even thinking about user interface, need to get the data structure correct. Identify the data entities and how they relate. Have you studied the referenced link or any other tutorials on relational database principles? Until you have a grasp of those principles, your db development experience will be constant frustration.
    Im talking about the code to delete the info from the selected row.

  11. #11
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    I already provided that in post 2.

    What you have to determine is what event to put code into. Do you want to use a button Click?

    If your data were properly structured, this code would not be needed.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Delete command to update record
    By angie in forum Forms
    Replies: 6
    Last Post: 12-23-2013, 05:26 PM
  2. Replies: 1
    Last Post: 06-21-2013, 10:41 AM
  3. Replies: 3
    Last Post: 10-19-2012, 04:30 PM
  4. Error handling for delete record command
    By jobrien4 in forum Access
    Replies: 2
    Last Post: 09-16-2011, 11:00 AM
  5. Command button help - delete record
    By Zukster in forum Forms
    Replies: 0
    Last Post: 08-27-2009, 08:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums