Results 1 to 14 of 14
  1. #1
    ijo68 is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Feb 2021
    Posts
    37

    How to make the Parameter value show up on Form Header

    Hello everyone,



    Is there a way to make the parameter value show up on a form the same way it can show up in a report?

    Eg. for a report I can create a unbound text box and put ="This Report is For " & [Enter Report Date]

    the [Enter Report Date is from the Parameter query I'm using to get the user input. and it shows up ..could that work for a form as well?
    Or does it have to be done differently.

  2. #2
    ranman256's Avatar
    ranman256 is online now VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    in the query add a field: Title: [Enter Report Date]
    along with the criteria param:
    [Enter Report Date]
    then the report can see the field: Title

    or
    dont use PARAMETER box in a query, instead put them on a form as textboxes.
    then your query can have the extra field here too:
    Title: forms!fMyForm!txtRptDate



  3. #3
    ijo68 is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Feb 2021
    Posts
    37
    hello ranman256, thanks for your reply. Is this is what you mean by adding title to query?
    Click image for larger version. 

Name:	form.jpg 
Views:	19 
Size:	77.8 KB 
ID:	44263
    Attached Thumbnails Attached Thumbnails query.jpg  

  4. #4
    ijo68 is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Feb 2021
    Posts
    37
    This is the correct image of query
    Click image for larger version. 

Name:	query.jpg 
Views:	17 
Size:	69.0 KB 
ID:	44265

  5. #5
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    Why make it more complicated than it needs to be, it is much easier to add two unbound text boxes to the form (as suggested by Ranman) and use those in your query: >=Forms!frmContacts!txtStart And Forms!frmContacts!txtEnd +1
    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  6. #6
    ssanfu is offline Master of Nothing
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Be aware that "Type" and "Group" are reserved words in Access and shouldn't be used for object names.

    Also, you shouldn't use spaces in object names ([Start Date] & [End Date]).

  7. #7
    ijo68 is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Feb 2021
    Posts
    37

    Thumbs up

    Quote Originally Posted by ssanfu View Post
    Be aware that "Type" and "Group" are reserved words in Access and shouldn't be used for object names.

    Also, you shouldn't use spaces in object names ([Start Date] & [End Date]).

    Thank You for that input, didn't know that..

  8. #8
    ijo68 is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Feb 2021
    Posts
    37
    Quote Originally Posted by Gicu View Post
    Why make it more complicated than it needs to be, it is much easier to add two unbound text boxes to the form (as suggested by Ranman) and use those in your query: >=Forms!frmContacts!txtStart And Forms!frmContacts!txtEnd +1
    Cheers,
    I tried that and it ran the query in datasheet,, I want the result in a continuous form.. for which the query is the record source.

  9. #9
    ssanfu is offline Master of Nothing
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Sorry, I should have included the reference

    Problem names and reserved words in Access


    Good luck with your project.......



    BTW, did you really mean "DateEntd"? Maybe it should be "DateEnd" (only one "t")?

  10. #10
    ijo68 is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Feb 2021
    Posts
    37
    Quote Originally Posted by ssanfu View Post
    Be aware that "Type" and "Group" are reserved words in Access and shouldn't be used for object names.

    Also, you shouldn't use spaces in object names ([Start Date] & [End Date]).
    would it be a big deal to correct that .. or could I do a find and replace in VBA Editor for the project after changing the name in the table?

  11. #11
    ijo68 is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Feb 2021
    Posts
    37
    Quote Originally Posted by ssanfu View Post
    Sorry, I should have included the reference

    Problem names and reserved words in Access


    Good luck with your project.......



    BTW, did you really mean "DateEntd"? Maybe it should be "DateEnd" (only one "t")?
    >short for date entered

  12. #12
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    Not sure I follow you, just set the form as a continuous form with the query as its recordsource and embed the form (as a subform) in another (main) form in which you place the two text boxes for the dates (in the header).

    Cheers,
    Vlad
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  13. #13
    ijo68 is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Feb 2021
    Posts
    37
    Quote Originally Posted by Gicu View Post
    Not sure I follow you, just set the form as a continuous form with the query as its recordsource and embed the form (as a subform) in another (main) form in which you place the two text boxes for the dates (in the header).

    Cheers,
    Vlad
    Ah.. I see what you mean now .. I'll try that Thank you for being patient with me..

    This is what I got....Three text boxes on main form ... txtStart .. txtEnd ..... txtUser continuous form has the query as recordsouce and ebeded as subform. The error is below..
    Click image for larger version. 

Name:	query.jpg 
Views:	10 
Size:	86.1 KB 
ID:	44269

    Click image for larger version. 

Name:	form.jpg 
Views:	11 
Size:	174.9 KB 
ID:	44270

    Click image for larger version. 

Name:	Error.jpg 
Views:	10 
Size:	53.8 KB 
ID:	44271

  14. #14
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    Could you please post a small sample with the form and table (please no sensitive data, just some "dummy" records to illustrate the issue)? Do you get the error when you open the main form? The subforms load before the form so at that time the unbound controls are empty (even if you set up default values as you should). Usually what I do is load the subform with all records (so the recordsource is the entire table or a query based on it with no criteria, maybe some sorting). Then once you populate the unbound controls click a button to "Refresh" the subform - it is just a matter of adding one line of code to the click event of the button:
    Code:
    Me.sfrmContacts.RecordSource="qryYourQueryThatReferencesTheFormControls"
    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

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

Similar Threads

  1. Replies: 2
    Last Post: 01-23-2018, 06:35 PM
  2. Replies: 5
    Last Post: 08-24-2017, 06:51 PM
  3. Replies: 2
    Last Post: 01-12-2017, 02:30 AM
  4. Replies: 5
    Last Post: 08-31-2015, 01:03 PM
  5. Replies: 1
    Last Post: 04-06-2014, 10:58 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
  •  
Other Forums: Microsoft Office Forums