Results 1 to 4 of 4
  1. #1
    Bcanfield83 is offline Advanced Beginner
    Windows 7 32bit Access 2016
    Join Date
    May 2018
    Posts
    81

    Question Display Record Count in form used to import scheduled files

    Hello,


    I have a form in my database that is used to import a series of scheduled reports that are saved to a network drive on the 1st of the month. There's 6 files in total, each of which are .csv files that use a common import specification.
    Each file gets imported into a different table in the database. I have a reference table that lists the File Name, Import Table Name, and Last Imported Date. This information displays in a List Box on that form. We then select the file from the List Box and click a button which calls the sub-procedure to import the file into that table.
    I'd like to update this to also display the record count for each file/table. Thus, after importing the file, the List Box would display the # of records that imported in another column.
    Is there a way to accomplish this without adding a new "Record Count" field to the aforementioned reference table (and then simply updating the List Box to display that additional column). I'm already familiar with how to use the DAO Recordset object to determine the # of records (count) in a table.

    So I guess what I'm asking is if there's a way to programatically (through VBA) display information in a List Box, or would it need to be incorporated into the existing Row Source (in this case, the Row Source type is a table) in order to display that additional column/field in the List Box?

    Thanks.

  2. #2
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,511
    Thinking cleanest way as you seemed to mention is to add the field to the table and include in the list box, then after an import runs, do the count code to populate that field for that table(import) record, then requery the list box to now display that data. Might be a way to update variables in the list box but you have a few when dealing with fields, sizes, number of columns, etc.

  3. #3
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,250
    If your 6 target tables have a DateImported (using a default value of Date() or Now() so it autopopulates on import) date field you can simply add a dCount with today's date as the criteria) to the row source of the listbox.

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  4. #4
    Bcanfield83 is offline Advanced Beginner
    Windows 7 32bit Access 2016
    Join Date
    May 2018
    Posts
    81
    Thank you both!

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

Similar Threads

  1. Replies: 6
    Last Post: 04-10-2018, 02:43 PM
  2. Open Form and Display Record Count
    By MatthewR in forum Forms
    Replies: 7
    Last Post: 07-02-2015, 02:34 PM
  3. Replies: 17
    Last Post: 06-04-2013, 07:36 PM
  4. Display value in a text box after scheduled date
    By venu_resoju in forum Forms
    Replies: 5
    Last Post: 01-06-2013, 01:13 AM
  5. Display record count
    By jgelpi16 in forum Reports
    Replies: 5
    Last Post: 11-30-2010, 09:02 PM

Tags for this Thread

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