Recent content by Squid1622

  1. S

    Solved Prevent Duplicate Entry with Multiple DLook Up's

    Thank you so much for all your help! :D
  2. S

    Solved Prevent Duplicate Entry with Multiple DLook Up's

    That worked like a charm. In the interest of learning, would you mind (at your leisure of course) commenting the code so that I can understand a little better why it worked?
  3. S

    Solved Prevent Duplicate Entry with Multiple DLook Up's

    So I removed the date field from the equation and replaced it with the vendor ID. It works as anticipated when the record is a duplicate. However, when I enter a new record I get a "Run time error 3021, No Current Record." It says the issue is at the part highlighted in red. Private Sub...
  4. S

    Solved Prevent Duplicate Entry with Multiple DLook Up's

    I had a feeling at the beginning that I would need to loop through a recordset at some point, I just didn't know when, where, or how. If you haven't already suspected, I'm not altogether proficient with using sql in vba. When I copied the code over to access, there appears to be an issue with...
  5. S

    Solved Prevent Duplicate Entry with Multiple DLook Up's

    I replaced the DCount with the query statement above and I also set my if statement to check if the Invoice Variable was greater than 0. I still can't enter any records, new or duplicate. Here is my code. Private Sub Form_BeforeUpdate(Cancel As Integer) Dim Invoice As Variant Invoice =...
  6. S

    Solved Prevent Duplicate Entry with Multiple DLook Up's

    Could you provide steps/coding to get this done?
  7. S

    Solved Prevent Duplicate Entry with Multiple DLook Up's

    How do I set up the query?
  8. S

    Solved Prevent Duplicate Entry with Multiple DLook Up's

    Next Attempt: Private Sub Form_BeforeUpdate(Cancel As Integer) Dim Invoice As Variant Invoice = DCount("*", "tblMaintenance", _ "[Amount]=" & Me.Amount & "And [InvoiceDate]=" & Me.InvoiceDate & _ "And [InvoiceNum]='" & Me.InvoiceNum & "'") If Not...
  9. S

    Solved Prevent Duplicate Entry with Multiple DLook Up's

    The VendorID is numeric. I have a combo box on the form that inputs the VendorID for a specific Vendor into the VendorID field on the form.
  10. S

    Solved Prevent Duplicate Entry with Multiple DLook Up's

    So here's some code I actually got to work. Private Sub Form_BeforeUpdate(Cancel As Integer) Dim Vendor As Variant Dim Amount As String Dim InvoiceDate As Variant Dim InvoiceNum As String Dim Answer As String 'Vendor = DLookup("[VendorID]", "tblMaintenance", "[VendorID] = " &...
  11. S

    Solved Prevent Duplicate Entry with Multiple DLook Up's

    Which would be quicker to run? The table right now stands at about 90,000 records. Would the query have to run through every record to determine if it was a duplicate? Would the VBA code run faster?
  12. S

    Solved Prevent Duplicate Entry with Multiple DLook Up's

    So I'm attempting to adopt some code that I came across in an effort to prevent people from double entering invoices. I think I understand the basic premise which is to use the DLookup to compare what has been entered to values already existing in the table and if it matches, then prevent the...
  13. S

    Solved VBA to Define Range for Upload

    namliam, Thank you for all your help. I now have a function that does exactly what I want it to do. I was able to make the changes on the code myself and this is what I came up with. Private Sub WorkOrdercmdBut_Click() If MsgBox("This will open the Excel folder for spreadsheet...
  14. S

    Setting Dynamic Range

    msk7777, I found that code on another website, unfortunately I've misplaced the address. When I found the code though, the original designer set the end range as "A65565". Essentially (at least as I interpret it) the code counts from end of your "static" range up to the last row you have text...
  15. S

    Solved VBA to Define Range for Upload

    Ok, so I've amended the method I'm using to this code I found here http://www.access-programmers.co.uk/forums/showthread.php?t=158308. Below is how I've amended it: Private Sub WorkOrdercmdBut_Click() If MsgBox("This will open the Excel folder for spreadsheet imports. Continue?"...
Top Bottom