Results 1 to 9 of 9
  1. #1
    Access_Novice is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Sep 2013
    Posts
    265

    InputBox in Control Source property is giving an infinite loop

    I have a text box as one of the fields in my report. In that box I used the expression builder to set up an input box so that the user could enter a date. In Report View, I get prompted. Then I enter a date and click OK. Then the box pops up again and again and again.



    I only want it to pop up once, so that the user can enter one date in one box and that's it.

    What am I doing wrong?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    In an input box coded in a textbox - never heard of such a thing. Why would you need an input box invoked by a textbox? Textbox is a data entry control. Use its properties to manage user input, not an input box.
    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
    Access_Novice is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Sep 2013
    Posts
    265
    Quote Originally Posted by June7 View Post
    In an input box coded in a textbox - never heard of such a thing. Why would you need an input box invoked by a textbox? Textbox is a data entry control. Use its properties to manage user input, not an input box.
    I don't know how to do what you are suggesting. When the form opens, I want the user to automatically be prompted to enter a date. And that date would be submitted to an unbound text box. That's what I had in mind.

    If I don't use a text box, what should I use?

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    You use a textbox and have form open with focus on that textbox. Can have code open a message box screaming "ENTER DATE NOW" if you want but that just annoys users and they can still leave the textbox after closing the message. Triggering an input box from a textbox expression accomplishes nothing except frustration, as you already experienced. Just not designed to work that way. Code would be in an event procedure or macro behind the form and pass the value from the input box to the textbox. Manage data validation by other means. One is to set the field as required, other methods involve code to verify data before record is saved.
    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
    Access_Novice is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Sep 2013
    Posts
    265

    InputBox in Control Source property is giving an infinite loop

    Quote Originally Posted by June7 View Post
    You use a textbox and have form open with focus on that textbox. Can have code open a message box screaming "ENTER DATE NOW" if you want but that just annoys users and they can still leave the textbox after closing the message. Triggering an input box from a textbox expression accomplishes nothing except frustration, as you already experienced. Just not designed to work that way. Code would be in an event procedure or macro behind the form and pass the value from the input box to the textbox. Manage data validation by other means. One is to set the field as required, other methods involve code to verify data before record is saved.
    Ok, but instead of using a form to accept user input, can you do this with a report? I want the user to open a report, then enter Sunday's date into the text box. I would also have text boxes for all other days of the week which would add 1 to the previous day, so that all other textboxes/days would auto populate based on the user input.

    So can I accept user input in a Report?

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    No, forms are for input, reports for output.
    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
    Access_Novice is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Sep 2013
    Posts
    265
    Quote Originally Posted by June7 View Post
    No, forms are for input, reports for output.
    Ok. Thank you.

  8. #8
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    You can have the report control (textbox) refer to a control on a form to get the data (date).

    Lets say you have a report named "MyReport", with an unbound text box control in the header named "MyReportDate".
    And you have a form named "MyForm", with a text box control named "MyFormDate".

    Set the control source for "MyReportDate" to "=Forms!MyForm.MyFormDate" (no quotes)

    Open the form "MyForm" and enter a date into the control "MyFormDate". Tab to another control to ensure the date is entered into the control.

    Now open the report.

  9. #9
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    Access_Novice, I might have misunderstood your question. As Steve describes, a report can be dependent on value entered on a form. However, once the report is opened, a change in the form control will not affect the report without running a refresh action or closing/reopening report.
    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.

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

Similar Threads

  1. Possible Infinite Loop
    By dandoescode in forum Access
    Replies: 1
    Last Post: 05-18-2012, 11:03 AM
  2. Column Control Source Property
    By rts in forum Reports
    Replies: 6
    Last Post: 05-17-2012, 06:42 PM
  3. Replies: 5
    Last Post: 10-13-2011, 03:36 PM
  4. SQL vs. vba Row Source property
    By eww in forum Programming
    Replies: 7
    Last Post: 10-15-2010, 11:02 AM
  5. Replies: 9
    Last Post: 04-28-2010, 11:20 AM

Tags for this Thread

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