Results 1 to 12 of 12
  1. #1
    joepet is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jun 2013
    Posts
    5

    combo box and delete record button not working properly

    Hi all,

    there're two main problems I can't solve because of limited knowledge of access:
    * Delete button in Form1 doesn't work, my main goal is that it would delete employee record and all related records in related tables.
    * After selecting employee name in combo box, related info does not appear in the form (no result).

    Can anybody comment why this problem exist and suggest probable solution.

    Thank You in advance



    P.s. database is attached
    Attached Files Attached Files

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Do you need to stick to Macro's or will Code work for you?

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,850
    Can anybody comment why this problem exist and suggest probable solution.
    I don't see a DELETE button. And as Allan said, since this is your first post do you have to use macros?

    For a first project, I would recommend you use a naming convention that does NOT allow embedded spaces (or special characters) in field or table names. It will save you a lot of frustration with syntax issues in future.
    I would also stay away from MultiValue fields, Attachments etc until I was comfortable with table design and relationships.
    I would suggest using vba vs macros, just because of the availability of help for same on the forum.

    In general I would work from very simple to more complex. For example, a single table, a single form, with a single button - if all the button click did was display a message -great. Then move to something more sophisticated.

    There are a number of youtube tutorials that can help.
    Also there are a number of video tutorials at http://www.datapigtechnologies.com/AccessMain.htm

    Again, these are recommendations - use them if you wish.
    Good luck.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Your Delete button is just deleting the current record from the Trainnings table. In order to achieve what you stated you would need to delete the Employment Info record.

  5. #5
    joepet is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jun 2013
    Posts
    5
    thanks for reply, is there something you noticed wrong with relationships is set up?

  6. #6
    joepet is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jun 2013
    Posts
    5
    Quote Originally Posted by orange View Post
    I don't see a DELETE button. And as Allan said, since this is your first post do you have to use macros?

    For a first project, I would recommend you use a naming convention that does NOT allow embedded spaces (or special characters) in field or table names. It will save you a lot of frustration with syntax issues in future.
    I would also stay away from MultiValue fields, Attachments etc until I was comfortable with table design and relationships.
    I would suggest using vba vs macros, just because of the availability of help for same on the forum.

    In general I would work from very simple to more complex. For example, a single table, a single form, with a single button - if all the button click did was display a message -great. Then move to something more sophisticated.

    There are a number of youtube tutorials that can help.
    Also there are a number of video tutorials at http://www.datapigtechnologies.com/AccessMain.htm

    Again, these are recommendations - use them if you wish.
    Good luck.
    thanks for reply, is there something you noticed wrong with relationships is set up?

  7. #7
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I don't see anything wrong with your relationships.

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    When your form displays a 1:M record, why would you expect it to delete the 1 side rather than the Many side?

  9. #9
    joepet is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jun 2013
    Posts
    5
    Quote Originally Posted by RuralGuy View Post
    When your form displays a 1:M record, why would you expect it to delete the 1 side rather than the Many side?
    Regarding macros - no, i do not necessarely need to stick to them, I just proceeded the way I knew. I found VBA code sample for deleterecord and copied it to my database (sample attached), however as previous times it just clears the contents from form, but records in table are not touched...
    Attached Files Attached Files

  10. #10
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Try this db.
    Attached Files Attached Files

  11. #11
    joepet is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jun 2013
    Posts
    5
    Quote Originally Posted by RuralGuy View Post
    Try this db.
    RuralGuy,

    it works perfectly so far, thanks a lot! So was the problem in my case that integrated button with wizzard was not linked to correct table and where it was linked?

  12. #12
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    The answer to your question is in my post #8.

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

Similar Threads

  1. Delete button not working if there is code in onCurrent
    By accessnewb in forum Programming
    Replies: 4
    Last Post: 08-18-2011, 07:56 AM
  2. Replies: 9
    Last Post: 03-29-2011, 07:08 PM
  3. Delete SQL statement not working properly
    By Alexandre Cote in forum Programming
    Replies: 3
    Last Post: 10-18-2010, 12:56 PM
  4. Add Record Button isn't working
    By tmcrouse in forum Forms
    Replies: 6
    Last Post: 08-02-2010, 02:09 PM
  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