Results 1 to 13 of 13
  1. #1
    jactheblock is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Mar 2020
    Posts
    6

    Question I want to be able to count the number of fields in a table and for it to generate a number

    I have created a form that shows the members and how many bookings they have made. I just want to make a box that shows how many bookings have been made in numerical form, because at the minute, it is just shown in a sub-form table. I am a newbie with Access so i believe this is actually quite simple but i do not know how to do this. Thanks for any help!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,523
    The # of fields in a table should have nothing to do with # of bookings.
    you should count the bookings in 1 single field via query. Booking Date field?

  3. #3
    jactheblock is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Mar 2020
    Posts
    6
    So there is no way to count the number of data added to a sub-form? I have 2 inputted data, surely there's a way to just count that up without making a query. I am incapable of making queries so i try to avoid them as much as possible

  4. #4
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,411
    in your subform design, show the navigation bar?

    in your subform header of footer you can have a textbox with the sourceobject set to

    =Count([BookingID])

    change BookingID to a name of one of your fields (not controlname) in your subform

  5. #5
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,523
    Do you mean count the values in a field?
    yes, run a count query.

  6. #6
    jactheblock is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Mar 2020
    Posts
    6
    I have ran a count query and it now counts the number of values in a field, but i dont understand how to get this value into a form now....

  7. #7
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,411
    your reluctance to share basic information or to comment on the suggestions already makes it very difficult to help you. There is no 'standard way' of doing things so we are guessing at what you might actually have at the moment.

    Providing some example data, the outcome required from that example data, a screenshot of your form will go a long way towards enabling people to help you

  8. #8
    jactheblock is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Mar 2020
    Posts
    6
    I'm sorry, its just very difficult to explain because im doing this in Welsh, and hardly understand what i am doing at the moment anyway...

    I am making a database for a made-up gym, and for this task i need to record and update class credits purchased by making a Form. I have set up the form to show the members of the gym, and to show how many of the class credits that they have purchased in a sub-form. I need a simple way of showing how many class credits have been used in a number on that form. From this, the members will know how many class credits they have left. What else do you need to know?

  9. #9
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,411
    descriptions help us understand the context of what you are trying to do, but not how you are doing it so I repeat - show some data/screenshots etc. You say you have a form - so show it with some example data and what the outcome is required from that sample data. At the moment the information we have is the equivalent of you saying to a garage 'I have a green car, it has some wheels but it won't start'

    Also please comment on the potential solutions posted in post #4

    And just out of curiosity, why are you doing this in welsh?

  10. #10
    jactheblock is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Mar 2020
    Posts
    6
    Click image for larger version. 

Name:	access2.jpg 
Views:	16 
Size:	107.0 KB 
ID:	41389Click image for larger version. 

Name:	access1.jpg 
Views:	17 
Size:	162.8 KB 
ID:	41390Here's some screenshots. What else do you want to see? I am a bit confused to what Comment 4 means. what is 'sourceobject' and 'controlname'? I have tried =Count([TanysgrifiadFisol_ID]), but that only comes up with an Error. I am doing this project in Welsh because those are the rules that have been set by the examiner

  11. #11
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,411
    per post #4, your 'count' control needs to be in the subform header or footer. If you want to see it in the main form, then you need to reference it

    so copy the control to the header section of your subform - give it a name, suggest "ctlCount"

    then in your main form, create a new control and put this in the controlsource

    =tbl_an????.form.cltCount

    (sorry, can't read the name of your subform but that is what tbl_an???? is supposed to be

    I am a bit confused to what Comment 4 means. what is 'sourceobject' and 'controlname'?
    these are properties. In the ribbon, click on properties to display them for whatever object has the focus at the time - an object might be form, section (header/footer/detail etc) or a control. Controlname speaks for itself. Sourceobject only applies to a subform and is the name of a form, report, table or query. My bad, I meant controlsource which will be the name of a field from your form recordsource or a calculation such as used in your count control.

    As far as using Welsh is concerned - interesting challenge, but the principles are exactly the same.

  12. #12
    jactheblock is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2020
    Posts
    6
    Right, sorry for taking awhile to relpy...

    Can you simplify what you previously said in post #11? I really dont understand Access whatsoever.
    What are controls?
    How do i reference it?
    Am i giving a name to the subform, so it replaces tbl_tanysgrifiadfisol, or is the name going somewhere else?
    Where is the control source?
    How do i make a new control?
    I dont have properties in the ribbon. How do i get this?

    Sorry for being so annoying, im thankful for all of the help so far

  13. #13
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,411
    If you are not even aware of the basics I strongly recommend you do a couple of online courses about access to get some understanding. I can't recommend any specifically, just google 'ms access online courses' and you will get plenty of hits

    To answer your questions as best I can

    What are controls? - they are the 'objects' on a form or report. There are many types, the most common being textboxes and labels. Textboxes display data in one form or another, labels provide a description
    How do i reference it? by its name
    Am i giving a name to the subform, so it replaces tbl_tanysgrifiadfisol, or is the name going somewhere else? subforms are another form of control - it usually defaults to the name of the underlying form.
    Where is the control source? in properties under the data tab (if you cannot see the properties form, click on the properties sheet button on the ribbon)
    How do i make a new control? by selecting one from the ribbon and then clicking where you want it to appear on the form
    I dont have properties in the ribbon. How do i get this? if you cannot see the properties form, click on the properties sheet button on the ribbon

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

Similar Threads

  1. Replies: 7
    Last Post: 07-01-2019, 11:50 PM
  2. Replies: 2
    Last Post: 08-04-2017, 12:37 PM
  3. Replies: 7
    Last Post: 12-09-2016, 12:33 PM
  4. Replies: 2
    Last Post: 10-12-2016, 05:48 PM
  5. Replies: 6
    Last Post: 07-25-2011, 01:54 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