Results 1 to 3 of 3
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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?
    Attached Files Attached Files

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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
    Francois

  3. #3
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Perfect!! Thank you Francois!!

Posting Permissions

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