Results 1 to 4 of 4

QuantityAllocated expression can't be replicated?

  1. #1
    QuietPenguin is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2019
    Posts
    3

    QuantityAllocated expression can't be replicated?

    I am in the process of trying to reverse engineer an online example database and work it into my own database.



    During this process I have come across the following expression in a query to calculate a field:

    QtyAlloc: QuantityAllocated([Popn],[PRunTOT],[Sopn],[ARunTOT])

    In the example database this works perfectly, but when I try to run it in my own db I get the following error:

    'Undefined function 'QuantityAllocated' in expression.

    I have all the field names correct, and the exact same syntax as the example database. Does anyone know why am I getting this error? A google search for "QuantityAllocated function ms access" has yielded nothing, and has me believing that this is no longer an accepted function? In that case why does the old database still work perfectly in my version of access (Microsoft Office Professional Plus 2016 for reference).

    Any help with this would be greatly appreciated!

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    5,513
    Your old database has the function. Your new one does not. You likely won't find any web reference to it because it's proprietary (it's a user defined function, or UDF).
    Open your old db where this works and ctl+G to open your vb editor and ctl+F and search for the name. Make sure you select to search the whole project. You'll either need to copy the function or import the whole module, depending on what you need. Take note of what kind of module it is in - form, report, class or standard and post back if you need help after you find it.

    EDIT
    I guess I could also point out that you may have copied over the function but its name is now misspelled, or you have it in your new db but its scope is such that it isn't visible to your query.
    - "doesn't work" is no help. Post err msgs and where.
    - Use code tags for code/sql. Implement changes in copies of your database.
    Sometimes I talk to myself - like when I need expert advice.

  3. #3
    QuietPenguin is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2019
    Posts
    3
    You're a genius! I was able to find the code in the vb editor exactly as you described.

    Thanks so much for the help! As you can likely tell I'm newish to Access, and while I roughly know my way around, I don't know any VBA and have not explored that side of access at all yet.

    Thanks again!

  4. #4
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    5,513
    You're welcome. Glad I could help.

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

Similar Threads

  1. Replies: 2
    Last Post: 03-11-2019, 12:26 PM
  2. Replies: 3
    Last Post: 01-09-2017, 01:28 PM
  3. Replies: 4
    Last Post: 10-31-2011, 08:39 AM
  4. Replicated New Tables Not Replicating Data
    By smyers in forum Access
    Replies: 0
    Last Post: 04-30-2010, 12:12 PM
  5. Replies: 0
    Last Post: 03-11-2009, 11:39 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
  •  
Tech Forums: Microsoft Office Forums