Results 1 to 9 of 9
  1. #1
    Join Date
    Jul 2003
    Location
    Portugal
    Posts
    111

    Unanswered: Delete or not delete is the question

    Deleting a record by button ou menu works fine, but by code it doesn't works (no error).

    What code is behind buttons or menu?

    I don't understand this (there is no subform in the form).

    I would like to ear you about this.

    Thank you.

    Ruas

  2. #2
    Join Date
    Oct 2003
    Posts
    19

    Re: Delete or not delete is the question

    how is your code?

    do you use SQL or do you use the DoMenuItem function?

  3. #3
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Wink

    Per SQL use the

    DoCmd.RunSQL ("DELETE * FROM urTAble WHERE myField=urCriteria")

    You can use a RecordSet and go through it record for record and make the comparison, if it true the use
    yourRecSet.DELETE

  4. #4
    Join Date
    Oct 2003
    Location
    São Paulo - Brazil
    Posts
    91
    Wich code are you using ? I mean, the one that doesn´t work.

  5. #5
    Join Date
    Jul 2003
    Location
    Portugal
    Posts
    111
    The code that is generated by access when we put a button in a form and we choose the delete action.

    Thank you very much.

    Ruas

    Originally posted by Mixirica
    Wich code are you using ? I mean, the one that doesn´t work.

  6. #6
    Join Date
    Oct 2003
    Location
    São Paulo - Brazil
    Posts
    91
    In your first post you´ve said : "Deleting a record by button ou menu works fine"

    Wich button works ? Sorry, I need to undertand your problem, in order to solve it - At least, I´ll try
    My environment: Windows XP/ Access 2000 - Using Microsoft DAO 3.6 Library

  7. #7
    Join Date
    Aug 2003
    Location
    Argentina
    Posts
    465
    jmruas:
    You have a form in which you added a button to eliminate records with the Access assistant. Perhaps you have committed algun error when answering the questions of the Access assistant. For that reason the button does not work. But if the form shows a record the button must work.
    Saludos
    Norberto

  8. #8
    Join Date
    Jul 2003
    Location
    Portugal
    Posts
    111
    Ok, I'm sorry, I'll try explain better the problem.

    A record can be deleted by the menu option Edit->Delete Record or creating a button using the Access assistant. Here we write nothing. All code is generated by the assistant.

    If I want to delete a record using this button created by assistant, it seems the record as been deleted, but when opening the form again, the record is there.

    If is used the menu option Delete Record, the record is deleted indeed.
    I don't understand why!

    Ruas



    Originally posted by Norberto
    jmruas:
    You have a form in which you added a button to eliminate records with the Access assistant. Perhaps you have committed algun error when answering the questions of the Access assistant. For that reason the button does not work. But if the form shows a record the button must work.

  9. #9
    Join Date
    Aug 2003
    Location
    Argentina
    Posts
    465
    If you want send me a sample base in Access 97 and i see what is the problem, them i send to you with the update.
    Saludos
    Norberto

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •