Results 1 to 2 of 2
  1. #1
    Mrdude1020 is offline Novice
    Windows 8 Access 2013
    Join Date
    Jul 2014
    Location
    Boone
    Posts
    11

    Working on a Cross Comparison Database

    So I'm working on making a cross comparison database with 3 different food vendors we use when ordering or food/ingredients for the restaurant. I am able to get up-to-date prices by exporting all their catalogs through excel then importing that into access. However I've made a button for each of the tables that should automatically update the tables when I export the newest file but I cant seem to get them to update. Also I have three buttons with basically the same code for each, just a different name of the file. The code im using for the command button is:

    Dim strFile As String

    DoCmd.SetWarnings False

    ' Set file directory for files to be imported
    strPath = "C:Shares\Public\Staff Public Files\Brandon Penland\US Food Product Prices Newest\"
    ' Tell it to import all Excel files from the file directory
    strFile = Dir(strPath & "*.xls*")

    ' Start loop
    Do While strFile <> ""
    ' Import file
    DoCmd.TransferSpreadsheet transfertype:=acImport, tablename:="US Food Product Prices Newest", FileName:=strPath & strFile, HasFieldNames:=True, Range:="default"
    ' Loop to next file in directory
    strFile = Dir
    Loop



    MsgBox "All data has been imported.", vbOKOnly
    End Sub

    Also im trying to have a seach feature that allows for searches for keywords to search across the three tables, but do they all have to be unifrom in the column titles for that to work? And what would be the best way to show the results, a report? Please help!

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Review this example for looping through files in a folder http://www.allenbrowne.com/ser-59.html. Note the condition to skip . and .. hidden files.

    Missing a backslash in the filepath - C:\Shares
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 8
    Last Post: 08-07-2013, 02:10 AM
  2. Replies: 4
    Last Post: 04-04-2013, 06:51 AM
  3. Replies: 3
    Last Post: 09-13-2012, 11:17 AM
  4. Replies: 4
    Last Post: 06-15-2011, 03:55 AM
  5. Working on a split database at home
    By ksmith in forum Programming
    Replies: 7
    Last Post: 05-23-2011, 06:02 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums