Results 1 to 6 of 6
  1. #1
    markcrobinson is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Location
    New Hampshire, US
    Posts
    31

    "Fill Right" on a Query

    I can do it in Excel --
    I've got a query of sales projections for the next 36 months. I want to put a number in the first month and have it, sometimes, fill to the end.


    Use a Macro? Add a button? Something else?
    Ideas would be highly appreciated..
    Regards,
    Mark

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    What do you mean by 'fill to the end'? A record for each of the next 36 months?

    Requires VBA looping code to create records.
    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.

  3. #3
    markcrobinson is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Location
    New Hampshire, US
    Posts
    31
    Yes, highlight the quantity in the first cell, 5/2020, click a button or a keystroke to have it put that number in every cell through 12/2022
    I can do the VBA, I just don't want the data entry person to have to leave the query. Can I activate VB program while displaying a query? Add a button to a query?

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    Are you in Excel or Access?

    Users should not interact with tables and queries, shouldn't even see them.

    Cannot have code for this behind Access table or query. Access does not work like Excel. Forget everything you know about Excel if you are working with database.
    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.

  5. #5
    markcrobinson is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Location
    New Hampshire, US
    Posts
    31
    This is for projection

    jan feb mar apr may jun ....
    Product 1

    I want to put a number in Jan and have it fill to the end of the year.
    I realize this is better suited to Excel -- but there is a lot more that the access program does for me.
    I realize that you "shouldn't" interact with a query
    Forgetting Excel is not helpful here...

    ... nonetheless, I am looking for a way to do this.
    I can have a msgbox come up and lots of "hard ways" for the user to do this, but some method where I could simulate a "fill Left" would be very useful here.

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    You have a field for every month?

    I suppose an UPDATE query could do this.

    UPDATE table SET Feb=Jan, Mar=Jan, Apr=Jan, May=Jan …

    Otherwise, need VBA.
    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: 3
    Last Post: 06-06-2018, 08:26 PM
  2. Replies: 4
    Last Post: 01-17-2018, 03:29 PM
  3. Replies: 1
    Last Post: 09-07-2015, 08:00 AM
  4. Replies: 5
    Last Post: 02-05-2013, 10:57 PM
  5. Replies: 2
    Last Post: 09-29-2012, 11:22 PM

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