Search results

  1. G

    Warn about conflicting entries and offer choice to edit conflicting entry or current

    before update code Private Sub Form_BeforeUpdate(Cancel As Integer) Dim intCheck As Integer Dim strDates As String Dim strDuration As String Dim strTrainer As String Dim strCondition As String Dim strMessage As String Dim intResponse...
  2. G

    Warn about conflicting entries and offer choice to edit conflicting entry or current

    do you want me to paste the before update code and the multiple records code in full?
  3. G

    Warn about conflicting entries and offer choice to edit conflicting entry or current

    Yep I created the module and pasted the code. I've renamed it mdlDuplicatesCheck as you suggest. I went to debug then compile and got a new compile error. This time it's on the line from the before update code DuplicatesCheck = True. Duplicates check= is highlighted and the error is...
  4. G

    Warn about conflicting entries and offer choice to edit conflicting entry or current

    I'm getting a compile error on the 'Create_multiple_Records' code. The line is If DuplicatesCheck = False Then The compile error is type mismatch and the = symbol is highlighted
  5. G

    Warn about conflicting entries and offer choice to edit conflicting entry or current

    Thank you so mch for the time that you have spent on this. As I said I was away from my PC so am just getting to this now. So I've created a module and put the function in. Then I've pasted the duplicates code into the the multiple records code called by the button. As you suggested I...
  6. G

    Warn about conflicting entries and offer choice to edit conflicting entry or current

    Public Sub DuplicatesCheck() Sorry was away from the PC for a while as the wife threatened to divorce me if I didn't take a break;)
  7. G

    Warn about conflicting entries and offer choice to edit conflicting entry or current

    Forgot to say but the compile error is Variable not defined
  8. G

    Warn about conflicting entries and offer choice to edit conflicting entry or current

    The save record sql creates the records. That I have tried and tested. So I tried putting your code into the multiple records code. When I click the button though absolutely nothing happens. No warnings, no debugger etc. Also when I try to compile the database I get and error with Cancel = So...
  9. G

    Warn about conflicting entries and offer choice to edit conflicting entry or current

    But how can I get round that? Running the sql is what creates the multiple records. If this is stupid idea please say so but Could Ipaste your code in it's entirety before the DoCmd.RunSql?????
  10. G

    Warn about conflicting entries and offer choice to edit conflicting entry or current

    Private Sub Create_multiple_records_Click() Dim strSQL As String 'As you are entering the first record manually with the end date the sql only addes the dates greater than the first date 'This only works where all fields are filled in - you should probably build in a check to see if the...
  11. G

    Warn about conflicting entries and offer choice to edit conflicting entry or current

    The records are saved using the 'Create Records button which has code behind it which may be clashing. The code at present looks like this Private Sub Form_BeforeUpdate(Cancel As Integer) Dim intCheck As Integer Dim strDates As String Dim strDuration As String...
  12. G

    Warn about conflicting entries and offer choice to edit conflicting entry or current

    I'm almost scared to tell you this. With the new code it let me enter a set of new records as it should. But then I entered a duplicate record for one of the dates and it allowed me to. :(
  13. G

    Warn about conflicting entries and offer choice to edit conflicting entry or current

    Apologies I just thought it would save you some work. I'm also wondering if the following should be changed to: strMessage = "This event clashes with" & IIf(intCheck = 1, " an ", " ") & _ "existing event" & IIf(intCheck > 1, "s", "") & _...
  14. G

    Warn about conflicting entries and offer choice to edit conflicting entry or current

    So close.... I did the Dim strTrainer_Name as string and amended the str condition to: strCondition = "(#" & Me.Start_Date & "#" & BTWN_DATES & strDuration & strTrainer_Name & ")" & _ " OR " & _ "(#" & Me.End_Date & "#" & BTWN_DATES & strDuration &...
  15. G

    Warn about conflicting entries and offer choice to edit conflicting entry or current

    It's a bit late in the day to think of this but could a find duplicates query have been amended to do this or is that just the same as using indexes in the resourcing table?
  16. G

    Warn about conflicting entries and offer choice to edit conflicting entry or current

    I'm back to getting a syntax error when I add Trainer_Name Do I need to set up some sort of Dim? Something like Dim strTrainer_Name as string Here's what I'm attempting to run: Private Sub Form_BeforeUpdate(Cancel As Integer) Dim intCheck As Integer Dim strDuration As String Dim...
  17. G

    Warn about conflicting entries and offer choice to edit conflicting entry or current

    First sorry for my late response. I've been delivering training today and will be again tomorrow so can't always respond when I would like to. Yes you are making sense. I think we're both on the same page although you express it better than me because you know what you are talking about...
  18. G

    Warn about conflicting entries and offer choice to edit conflicting entry or current

    That's exactly right. So a conflict would be any event that had the same combination of Trainer_Name, Start_Date and Duration within the range of start and end dates entred. Hope that makes sense outside of my own head
Back
Top Bottom