Results 1 to 6 of 6
  1. #1
    DOC666 is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2014
    Posts
    3

    Textbox and contents will not display

    Can anyone help please

    Code:
    Me.TxtNotAllowed.Visible = True
    dtTimer1 = Now
    dtTimer2 = Now + TimeValue("00:00:10")
    Me.TxtNotAllowed.Value = "You do not have permission to use this database !"
    Do Until dtTimer1 >= dtTimer2
    dtTimer1 = Now()
    Loop
    Me.TxtNotAllowed.Value = ""
    DoCmd.Quit
    The above code will run definitely for the 10 seconds however the textbox and contents do not display HOWEVER if stepped through with breakpoints line by line and the form checked each time the textbox DOES display and its contents.



  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I can not see the code you have there working. I tried a couple different things using datediff, dateadd, and other functions using the system clock. The only thing I could get to work properly was the form's timer event.

    Here is an example.
    Attached Files Attached Files

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,891
    It does appear after the timer completes. Remove or comment the DoCmd.Quit and will see the textbox.

    Sorry, don't know how to make the textbox show immediately. Don't know why timer loop interferes.
    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.

  4. #4
    DOC666 is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2014
    Posts
    3
    Gentlemen,

    Thanks for both your help.
    Another MVP on another forum suggested putting "DoEvents" in front of the loop.
    I have tried this and it does work !!
    Will have to bone up on this function to see how it works !!

    Thanks again

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,891
    Great! Glad you have solution. I have used Do Events only once. Now I have better understanding of it.
    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.

  6. #6
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Do you care to share your final working code here? What event is your code in?

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

Similar Threads

  1. Replies: 7
    Last Post: 10-18-2012, 12:49 PM
  2. Replies: 5
    Last Post: 05-22-2012, 08:06 AM
  3. Replies: 5
    Last Post: 04-18-2012, 12:04 PM
  4. Replies: 2
    Last Post: 11-16-2010, 10:55 AM
  5. Replies: 0
    Last Post: 04-19-2008, 09:08 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