Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2012
    Posts
    5

    Unanswered: Textbox Auto Populate (If Today = Monday Then "My Text")

    Hello All

    Been searching for most of the day but can't find out how to do this.

    I would like to have an unbound textbox in my form that displays a certain text depending on what day of the week it is:

    For Example:
    If today is Sunday then the text box value would be "Low Carb Day"
    If today is Monday then the text box value would be "Low Calorie Day"
    and so on for all weekdays.

    Is there an easy way to accomplish this?

    I appreciate any help you can provide

  2. #2
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Code:
    Private Sub Form_Load()
    
     Select Case Weekday(Date)
      
      Case 1
        Me.TargetTextbox = "Sunday's message"
    
      Case 2
        Me.TargetTextbox = "Monday's message"
    
      Case 3
        Me.TargetTextbox = "Tuesday's message"
    
      Case 4
        Me.TargetTextbox = "Wednesday's message"
    
      Case 5
        Me.TargetTextbox = "Thursday's message"
    
      Case 6
        Me.TargetTextbox = "Friday's message"
    
      Case 7
        Me.TargetTextbox = "Saturday's message"
    
     End Select
    
    End Sub

    Simply replace TargetTexbox with the actual name of your Unbound Textbox and the messages to be displayed.

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    Join Date
    Aug 2012
    Posts
    5

    This works great

    Thank you very much this works great

  4. #4
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Glad we could help!

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

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
  •