Results 1 to 5 of 5
  1. #1
    Bkper087 is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    May 2014
    Posts
    81

    Use name of Table to populate field value in query column

    I am creating a database for budgets that are pulled from another source. It's an attempted workaround to get the info I need filtered and keep track of it accordingly. Not really what access is intended for I know, but It will work to accomplish what I'm trying to do.



    I named the table the budget project code number (example below the table would be named 1000). Can I somehow refer to that to populate a column in a query?

    The goal is for it to look like this:

    Project Code Other Info
    1000 asdfa;sljfkdl;
    1000 ;akdfj;lsdjf

  2. #2
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,389
    Not a good idea to start a table name with a number, but this for example:

    sSQL= "Select * FROM 1000"

    would be the same as this:

    sSQL="Select * FROM " & [Project Code]

  3. #3
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Also a bad idea to use spaces in object names!!

  4. #4
    Bkper087 is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    May 2014
    Posts
    81
    I'm aware its typically a bad idea- like i said in the description, this isn't needed to build a "database" just using it to repeat a process through pre-set filters that you can do in a query.

  5. #5
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    Your posts are confusing??????

    I am creating a database for budgets
    this isn't needed to build a "database"

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

Similar Threads

  1. Replies: 5
    Last Post: 03-07-2019, 09:00 AM
  2. Replies: 2
    Last Post: 06-17-2015, 09:08 PM
  3. How to auto-populate a field based on a query on another table
    By lissy_vincent@yahoo.com in forum Forms
    Replies: 2
    Last Post: 02-17-2014, 04:08 PM
  4. Replies: 2
    Last Post: 11-27-2013, 05:24 PM
  5. Replies: 3
    Last Post: 05-19-2010, 10:08 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