Results 1 to 5 of 5
  1. #1
    data808 is offline Noob
    Windows XP Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    727

    Auto fill date into unbound text box

    Ultimately, I would like this date to be recorded into the table with the record but if its too hard, then unbound is fine too.

    I have a form that I would like to have a date filled in to one of the unbound text boxes if one of the other fields is entered with data. How do I get this done? Just the date is fine. I don't need the time.



    Thanks.

  2. #2
    trevor40's Avatar
    trevor40 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    407
    Just set the Default value to Date() for the field and set the format to what you want.
    works the field bound or not.

  3. #3
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Quote Originally Posted by trevor40 View Post
    Just set the Default value to Date() for the field and set the format to what you want.
    works the field bound or not.
    That will place a date in the target textbox regardless of whether the first textbox is populated or not!

    This kind of thing should do:

    Code:
    Private Sub FirstTextboxName_AfterUpdate()
     
     If Nz(Me.FirstTextboxName, "") <> "" Then
      Me.TargetTextbox = Date()
     Else
      Me.TargetTextbox = Null
     End If
    
    End Sub

    Linq ;0)>

  4. #4
    data808 is offline Noob
    Windows XP Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    727
    This will do just fine. Thanks so much. Thank you also missinglinq.

  5. #5
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Glad we could help!

    Linq ;0)>

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

Similar Threads

  1. Replies: 5
    Last Post: 11-09-2012, 04:18 PM
  2. auto fill text box from dependent combo box
    By tommyried in forum Access
    Replies: 6
    Last Post: 06-17-2012, 03:55 PM
  3. Replies: 15
    Last Post: 04-01-2011, 11:41 AM
  4. Auto fill-in text box on forms
    By windwardmi in forum Forms
    Replies: 7
    Last Post: 09-13-2010, 02:47 PM
  5. auto fill certain text fields?
    By darklite in forum Forms
    Replies: 4
    Last Post: 07-12-2010, 02:20 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