Results 1 to 4 of 4
  1. #1
    catphe10 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2016
    Posts
    4

    autofill cells

    Hello All,

    I am trying to create a database with access and was hoping to get a little help.

    What i am trying to do is have multiple cells populate themselves.

    so here is the situation.
    In the first column i have a specific number, for example, 44005162020. (all items in the first column will have a number similar to this, all will have the same number of digits)
    So in the 5 column i want it to auto populate with only the first digit from column 1. so it would be a 4
    in column 6 i want to auto populate with the 2nd and 3rd digit. it would be a 40.
    in 7th column would be 4th and 5th digit. it would be 05.
    and so on.

    Any help is greatly appreciated!

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,728
    Cells are specific to spreadsheet(Excel).

    Code:
    Excel allows users to crunch numbers,  maintain lists and share data.
     It also allows users to export and import  various types of data for manipulation and analysis.
     Access has more  functions, making it a more powerful and complex program.
     Users can  manage more data, and several users can work in an Access database  simultaneously.
     Access is ideal for managing business contacts, tracking  customer orders, organizing staff jobs,
     managing tasks and maintaining  product inventories.
    From https://www.reference.com/technology/difference-between-access-excel-1c4db066f05c7675#

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,523
    I would either store the separate components or the full number, not both. In any case, check out the Left(), Right() and Mid() functions.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,809
    You can do this in Access (like many things) but just because you can does not mean you should. Not only may this be an example of repeating stored data, if the full number should ever change, the parsed parts of your record are no longer accurate. Forms and queries, and code when necessary, are the preferred method of manipulating data presentation, so that the data does not change. However, if you must, then I'd create an update query and extract the values from the number using the Mid function. This calculation expression would go in the query design grid where you'd normally place the value you want the query to write to the table.
    Here's a link on how to use the Mid function http://www.techonthenet.com/access/f...string/mid.php
    If you don't know how to create an update query, there are lots of tutorials and information. Try searching on ms access calculated query field

    Edit: decided to add the expressions for your case
    Mid(44005162020,1,1)
    returns 4
    Mid(44005162020,2,2)
    returns 40
    Mid(44005162020,4,2)
    returns 05
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Merging Cells
    By pharrison74 in forum Reports
    Replies: 5
    Last Post: 02-02-2016, 10:52 AM
  2. Replies: 1
    Last Post: 02-14-2015, 02:29 AM
  3. Blank cells are Importing
    By Sumanth.Ganjam in forum Access
    Replies: 3
    Last Post: 01-08-2014, 08:04 PM
  4. Report cells will not collapes
    By Brian62 in forum Reports
    Replies: 5
    Last Post: 11-02-2010, 12:41 PM
  5. Bold Cells
    By jcsports31 in forum Access
    Replies: 12
    Last Post: 09-10-2010, 12:15 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