Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    normie is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    53

    Date Range on Form

    I have a form for a query...to use the date range a pop up box comes from the query...Is there a way I can enter the START and END dates in boxes on the form instead of the query entries?



    This form will be on a inside shered drive and this will make it easier for people looking for the data

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,898
    Yes, that is much better approach because can validate user entry.

    Query input parameter reference to textboxes named tbxStart and tbxEnd would be like:
    Forms!formname!tbxStart
    Forms!formname!tbxEnd

    The form will be where?
    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.

  3. #3
    normie is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    53
    Quote Originally Posted by normie View Post
    I have a form for a query...to use the date range a pop up box comes from the query...Is there a way I can enter the START and END dates in boxes on the form instead of the query entries?

    This form will be on a inside shered drive and this will make it easier for people looking for the data
    Does this need to be a seperate form or can I add it to the exsisting form? as well do I need to put parameters on the source qurey?

    The form is on a shared drive that is inhouse for people to view this form and able to put in the date

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,898
    Same form or another form - the form RecordSource would be the query with the parameters. I don't know what the RecordSource of the existing form is. If it is a query that includes the date fields, then add the parameters.
    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
    normie is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    53
    I have entered this in the control source =[Date]![tbxSTARTDATE] and I get an #Error message
    The name of the query for the form is DASHBORD DATA

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,898
    Why would you enter [Date]![tbxSTARTDATE] in control source? Control Source of what?

    I suggested you put reference to form controls in the criteria row of a query. That is where input parameters for query go.
    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.

  7. #7
    normie is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    53
    Not sure what I am doing wrong....the "between" criteria is on a query that is one of the 3 queries on the form query...where do I enter "Forms!formname!tbxStart
    Forms!formname!tbxEnd" and do I add text boxes to the form?....I want to be able to open the form and enter the date range there and not in the pop up boxes

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,898
    How does a form have 3 queries? Do you mean the form RecordSource is a join of 3 queries?

    Yes, must have textboxes on form in order to refer to them. These would be unbound textboxes for user to input date criteria.

    Put reference to form textboxes in place of the parameter prompts in the query.

    Show your complete query statement for analysis.

    Do you want to provide project for analysis?
    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.

  9. #9
    normie is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    53
    Please see attachment
    This has become a mission now
    Attached Files Attached Files

  10. #10
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,898
    Try this criteria - no quote marks:

    BETWEEN Forms!Dash!tbxStart AND Forms!Dash!tbxEnd
    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.

  11. #11
    normie is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    53
    I have followed all the above instructions and the text box will come up for the query and will select the data and I am able to enter the dates in txbStart and txbEnd boxes on the form but the result is blank in the form boxes

  12. #12
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,898
    You have form that has the query as RecordSource?

    The query refers to the unbound textboxes as parameters?

    One more step. After entering the date values into the textboxes the form must be requeried. You can click the Refresh button on the ribbon or run code.

    If you want a visual tutorial on building a filter onto a form, review this: http://datapigtechnologies.com/flash...tomfilter.html

    What do you mean by 'text box will come up for the query'? Nothing should 'pop up'.
    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.

  13. #13
    normie is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    53
    Query 1 has the data including the input dateand the txbStart and txbEnd parameters... Query2 uses query 1 except for the input date and sums the other values... the form is built on Query 2
    The unbound textboxes that the parameter query points at are on the form
    Hope this is clear

  14. #14
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,898
    I've never done that but it should work. Still need to Requery form after dates entered in boxes. Make sure the spellings of the boxes are correct. You have shown both txb and tbx.

    At this point, I probably can't help anymore unless you want to provide the project.
    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.

  15. #15
    normie is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    53
    Thanks for your help...I cant figure it out I run Query2 with the textboxes and get the results but the form for the same Query comes up blank after using the form boxes..I must be mising a step somewhere

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Date Range Report with Multiple Date Fields
    By StevenCV in forum Reports
    Replies: 13
    Last Post: 02-29-2012, 08:29 AM
  2. Replies: 7
    Last Post: 09-12-2011, 12:03 PM
  3. date range form values as parameters
    By cfnieder in forum Forms
    Replies: 8
    Last Post: 08-11-2010, 01:48 PM
  4. Date range query from form
    By Steve Barnes in forum Queries
    Replies: 2
    Last Post: 07-29-2010, 07:06 PM
  5. Search form with a date range
    By mantro174 in forum Forms
    Replies: 1
    Last Post: 02-11-2009, 10:45 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