• Conditionally Run Queries

    Author
    Topic
    #461642

    The code for the “Import from Spreadsheet” button on the startup form of the attached mdb appends the data from the attached Excel file but in case there are any modifications made to the Excel file for the same date span, I’d like to give the user the possibility to reimport the file so, in Private Sub Command142_Click(), how can I conditionally run the update query(qUpPortMazz) instead of the append query (qAppPortMazz) if that particular date span has already been imported?

    Viewing 0 reply threads
    Author
    Replies
    • #1172148

      Something like this ?

      if Isnull(dlookup(“DATA”,”portmazz”,”DATA = #” & cvdate(format(dlookup(“DATA”,”tmpTbl”),”mm/dd/yyyy”))& “#”)) then
      run the append query
      else
      run the update query
      end if

    Viewing 0 reply threads
    Reply To: Conditionally Run Queries

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: