Results 1 to 10 of 10
  1. #1
    Akchayan is offline Competent Performer
    Windows 7 64bit Access 2016
    Join Date
    Aug 2022
    Posts
    102

    Automatically create a new field in a report

    Hello everyone,




    I have a report that is connected to a form and takes most of the data from the form.
    The form looks like this:
    Click image for larger version. 

Name:	1.png 
Views:	24 
Size:	12.9 KB 
ID:	48891
    And the report like this(The pos from 10-15 takes all the data from picture 1 from the text fields etc):
    Click image for larger version. 

Name:	2.png 
Views:	24 
Size:	20.2 KB 
ID:	48892
    And my problem is I don't know how to do it if there are more inputs than fields in the report, so I would like to know if it would be possible if the user has e.g. more than 6 inputs that the report directly adds the fields below.


    Is there a way?


    Thank you for the help!

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,861
    Most reports have a detail section that prints as many records as exist for that report.
    You should only have 1 line of contols if they are repeating, then it does not matter whether you have 7,70 or 700
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    xps35's Avatar
    xps35 is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Jun 2022
    Location
    Schiedam, NL
    Posts
    229
    Your report should be connected to a table or a query.
    Groeten,

    Peter

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    Your form has 6 rows of unbound controls. User can't input more than those 6 rows. Your suggestion that user would input more than report can handle is nonsense.

    User inputs on form should go into a table. Instead of 6 rows of unbound controls, have 1 row with each control bound to a field. This is normal data entry form arrangement.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Akchayan is offline Competent Performer
    Windows 7 64bit Access 2016
    Join Date
    Aug 2022
    Posts
    102
    For example, if the user has only made 4 entries instead of 6, how can I make my fields "14" and "15" no longer visible and the distance to the bottom disappear - is there a way?
    So it looks like this:
    Click image for larger version. 

Name:	Screenshot 2022-10-13 124305.png 
Views:	16 
Size:	27.4 KB 
ID:	48899
    and I want that if there are only 4 entries as I said, the fields "14" and "15" disappear and the space between "13" and "16" also disappears and there is no gap between them.

  6. #6
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,861
    Quote Originally Posted by Akchayan View Post
    For example, if the user has only made 4 entries instead of 6, how can I make my fields "14" and "15" no longer visible and the distance to the bottom disappear - is there a way?
    So it looks like this:
    Click image for larger version. 

Name:	Screenshot 2022-10-13 124305.png 
Views:	16 
Size:	27.4 KB 
ID:	48899
    and I want that if there are only 4 entries as I said, the fields "14" and "15" disappear and the space between "13" and "16" also disappears and there is no gap between them.
    If you do it the 'normal' way, then these issues do not even exist?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  7. #7
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,001
    As others have said - Your form should be a continuous form and the report should mimic that.
    Nothing complicated about it.

    You can enter as many lines or as few as you need and your report would only display as many as were entered.
    Post up a copy of your database, I'm sure someone can adjust it to demonstrate the principles.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  8. #8
    Akchayan is offline Competent Performer
    Windows 7 64bit Access 2016
    Join Date
    Aug 2022
    Posts
    102
    What exactly is a continuous form?

  9. #9
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,861
    Quote Originally Posted by Akchayan View Post
    What exactly is a continuous form?
    I have Google on this laptop.

    https://www.youtube.com/watch?v=EJWNnSw0FhA

    Found via https://www.google.com/search?q=ms+a...hrome&ie=UTF-8
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  10. #10
    xps35's Avatar
    xps35 is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Jun 2022
    Location
    Schiedam, NL
    Posts
    229
    You obviously got the message that you should use a continuous report (and form). It is important to realize that this approach assumes that the data is stored in a table. This is obvious to me when you work with a database, but given your questions (also see "Transferring Values from Form too table"), I don't know if that is the case for you.
    Groeten,

    Peter

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

Similar Threads

  1. Replies: 2
    Last Post: 06-14-2020, 02:09 PM
  2. Replies: 9
    Last Post: 05-23-2017, 11:56 AM
  3. Replies: 1
    Last Post: 03-17-2017, 11:52 AM
  4. Replies: 1
    Last Post: 10-16-2013, 09:41 AM
  5. Replies: 30
    Last Post: 01-16-2012, 05:49 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