Results 1 to 14 of 14
  1. #1
    FriQenstein is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Posts
    98

    Generate TOTAL count from non-database entries

    Hello all,

    I'm working on a form, that generates a report, for incoming shipments. The incoming shipment has to have an invoice generated for verification of item received. I have the form setup so that the user can input the information and then print the RCVR invoice with the pertinent information.

    The issue I am having is, unlike using the =Count(*), I cannot do that with this situation because the items are not physically coming from the DB. The text fields are manually entered and then the report is generated from the corresponding fields. How would I go about counting the total items listed on the form?
    Click image for larger version. 

Name:	RCVR1.PNG 
Views:	17 
Size:	28.5 KB 
ID:	42800



    I'm assuming I would have to use some VBA code and set variables for each of those Qty boxes that can then be tallied upon the report being generated?

    Any assistance would be greatly appreciated.
    Thanks.

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,936
    are you saying the each row consists of unbound controls? - 10 rows, 50 controls?

  3. #3
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    Confusing. You can't use Count, but you want a total? They are not the same thing even though in the sample you show the resulting calculation is the same. Change one of those values to 2 and the count is 4, the total is 5. This is confusing too
    the items are not physically coming from the DB
    what does that mean? I think you mean the data isn't coming from the db, but then from where if not the db?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    If they are typing in entries ,it's in the database.
    then do count().

  5. #5
    FriQenstein is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Posts
    98
    Quote Originally Posted by Ajax View Post
    are you saying the each row consists of unbound controls? - 10 rows, 50 controls?
    Currently, yes.

  6. #6
    FriQenstein is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Posts
    98
    Quote Originally Posted by Micron View Post
    Confusing. You can't use Count, but you want a total? They are not the same thing even though in the sample you show the resulting calculation is the same. Change one of those values to 2 and the count is 4, the total is 5. This is confusing too what does that mean? I think you mean the data isn't coming from the db, but then from where if not the db?
    In the example I provided, there is no resulting calculation... the Total field is empty.

    "what does that mean? I think you mean the data isn't coming from the db, but then from where if not the db?"
    The data is not coming from the DB because it has not yet been entered into the DB. As I mentioned, this form is simply to create an Incoming invoice from equipment that has just arrived so, no, it is not yet in the DB. That happens after the invoice has been created.

  7. #7
    FriQenstein is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Posts
    98
    Quote Originally Posted by ranman256 View Post
    If they are typing in entries ,it's in the database.
    then do count().
    Again, as I already mentioned, no, the data is NOT in the DB. This information is ONLY to create an invoice. After the invoice is created, they will enter the items into the DB accordingly.
    So no, just because they are typing in entries does not mean it's in the database.

  8. #8
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,936
    are you saying the each row consists of unbound controls? - 10 rows, 50 controls?



    Currently, yes.
    in at case you need code something like this

    Assuming your qty controls are called qty1, qty2 etc

    Code:
    dim i as integer
    dim c as integer
    c=10
    for i=1 to 10
      c=c+isnull(me("qty" & i))
    next i
    Have to say, it's not the way I'd do it, but each to their own

  9. #9
    FriQenstein is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Posts
    98
    Quote Originally Posted by Ajax View Post
    in at case you need code something like this

    Assuming your qty controls are called qty1, qty2 etc

    Code:
    dim i as integer
    dim c as integer
    c=10
    for i=1 to 10
      c=c+isnull(me("qty" & i))
    next i
    Have to say, it's not the way I'd do it, but each to their own
    They are indeed labeled Qty1, Qty2, etc.
    I would be open to hearing your suggestion as to a better way of doing this.

    Thanks.

  10. #10
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2016
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Can you post a copy of this so readers can see what you have and what you need?

  11. #11
    FriQenstein is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Posts
    98
    Quote Originally Posted by orange View Post
    Can you post a copy of this so readers can see what you have and what you need?
    Post a copy of...?

  12. #12
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,936
    I would be open to hearing your suggestion as to a better way of doing this.
    use a table - might be a holding table, might be the destination table with a flag field to indicate status - such as not approved/printed/invoiced

    edit: further suggestion - if the idea is not to commit to the db until all information is entered, consider using an ado disconnected recordset or with dao use the begintrans/commitrans functions

  13. #13
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2016
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    A copy of the database you have. You have a form and some controls and related logic.
    I see ajax has suggested a temp/holding table which is where you could/would store values for history/audit purposes.

  14. #14
    FriQenstein is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Posts
    98
    Quote Originally Posted by Ajax View Post
    use a table - might be a holding table, might be the destination table with a flag field to indicate status - such as not approved/printed/invoiced

    edit: further suggestion - if the idea is not to commit to the db until all information is entered, consider using an ado disconnected recordset or with dao use the begintrans/commitrans functions
    Thanks. I will look into this.

    I know this all seems odd, but I do this for a reason. As you mentioned, when equipment comes in, we first create an invoice indicating its arrival. However, there are times where the shipment is in transit or the client may change their mind and now want it repaired, so upon those instances, we do not put the items into the DB until confirmed.

    Again, I know this is not the normal way, but I created this form for this entry simply as a go-to method to at least indicate the shipment arrived and is sitting in the warehouse unattended until confirmation from the client has been received.

    Thanks for the tips. I will look into the suggestions and get back to this post.

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

Similar Threads

  1. How to total multiple entries?
    By newuserthatneedsassistanc in forum Queries
    Replies: 1
    Last Post: 07-24-2017, 01:17 PM
  2. Replies: 2
    Last Post: 06-30-2016, 06:38 PM
  3. Replies: 11
    Last Post: 05-09-2014, 12:00 PM
  4. Replies: 2
    Last Post: 04-15-2014, 01:59 PM
  5. Generate Fixed Number of Entries
    By dustonabt12 in forum Reports
    Replies: 6
    Last Post: 07-10-2013, 01:55 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