Search results

  1. lodmark

    Solved Easiest way to search for unique items

    I've commented out the line with "Cancel = True" in the subroutine that calls for the function. After that it seemed to work. The problem was that I couldn't add data to a record without getting a message that the record already exist. Leif
  2. lodmark

    Solved Easiest way to search for unique items

    Actually I didn't....
  3. lodmark

    Solved Easiest way to search for unique items

    I've got more problems. After I've added the picture in "criteria" in the function that you created for me I can add a new record but I can only add it with these four fields. And if I try to add something later, like a genre, it says that the record exist's. Again I've messed up your code...
  4. lodmark

    Solved Easiest way to search for unique items

    Thanks! I fixed this and figured it out as you say above. Leif
  5. lodmark

    Solved Easiest way to search for unique items

    Thanks @MajP for your input. I've tried to fix this line by line with help from debug and internet. Now I'm stuck in this line of code. The error message says: Which I interpret as saying I have the wrong property somewhere. Probably in Image because it was not in the original code. Of...
  6. lodmark

    Solved Easiest way to search for unique items

    Hi @MajP Today I tried to add the code you suggested. I didn't change it a bit and I got this error message at first and every time I switch to another record. And it comes again when I click OK. What am I missing here? Leif
  7. lodmark

    Solved Easiest way to search for unique items

    I think I solved it myself. I noticed that the order of the fields in the function was different than they were when used in the sub so I changed it and then it seems to work. I did not know that it mattered so much. Could it be that simple? Leif
  8. lodmark

    Solved Easiest way to search for unique items

    Hi @MajP I need a little quickfix. I discovered that I need to have another field among those that makes a record unique. Together with the name of the album (record_name), the artist (artist_name_ID), media (record_media), the link to the album cover also needs to be unique. I have several...
  9. lodmark

    Solved Easiest way to search for unique items

    I took away the line "RunCommand acCmdSaveRecord" and then it worked fine. Wonder what's gonna happened next. 🤯 Leif
  10. lodmark

    Solved Easiest way to search for unique items

    BUT! I've still got the error message that "The record doesn't exist". And now it's stopped at RunCommand acCmdSaveRecord. So there is something other than this that's wrong. :cry: Leif
  11. lodmark

    Solved Easiest way to search for unique items

    Thanks Mick. That worked with a slight change of code. In the table, the field for the image is called record_picture not artist_picture. Leif
  12. lodmark

    Solved Easiest way to search for unique items

    Oops, that was a lot of code. I have been confident in the little snippets of code that you and others have written to me before. But I will definitely test this, it's fun to code! :D But I was hit by another error that I think has with the code you wrote to find any duplicates. I tried to put...
  13. lodmark

    Solved Easiest way to search for unique items

    Thanks (again) @MajP I chose a slightly different path. Instead of adding code to handle error messages here, I chose to add a check that the field is filled in in the "LostFocus" event. Here's what happened to Record_name: Private Sub record_name_LostFocus () If IsNull (record_name) Then...
  14. lodmark

    Solved Tips on good books on programming VBA

    I am thinking of buying some books where I can learn about programming VBA for MS Access. I'm not a direct beginner, I understand how the code is connected in principle, but I do not understand all the new features that have been added in recent years. My programming knowledge comes from Basic...
  15. lodmark

    Solved Easiest way to search for unique items

    I think that I get it now. You mean that i can put the code above int the event "Before update". But what about the "Sub Test()" When I call the funktion RecordExist(... I only gets the result for the record "Let's spend the night... So...... Sorry that I'm such a bad coder.
  16. lodmark

    Solved Easiest way to search for unique items

    What do you mean by this? What before update? I don't understand the code you presented in your last message. Leif
  17. lodmark

    Solved Easiest way to search for unique items

    I've tried that and it works. This stops me from enter a duplicate. It would be nice i I could get a messages that showed me the post that is already in the database. Is that to much to ask for? :unsure: ;) Leif
  18. lodmark

    Solved Easiest way to search for unique items

    Should I try to make a composite index för these three fields?
  19. lodmark

    Solved Easiest way to search for unique items

    Thank you @MajP for the input in this subjekt. You've found my real problem. In the table, it is no problem to find duplicates, but I want it to appear in the form if I try to enter a name of a record that has been used before, for the same artist and with the same media. I managed to create a...
  20. lodmark

    Solved Easiest way to search for unique items

    Hi @MajP . I need to know if a vinyl record is already in the database, I have some duplicates and they do not need to be in the database twice. But I have not found a way to create a key that works for this so I thought of using your FAYT for it. I changed the field for the name of the record...
Back
Top Bottom