Results 1 to 4 of 4

Thread: Enetering Dates and SSN

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2000
    Posts
    43
    What is the best way to set up a mskbox or txtbox to enter dates and SSN. I have been trying to find the best way to do this. I have a mskbox setup and formatted so that it works, but curious to see other ways.
    Tim

    VB6, SP4
    GT Vengeance

  2. #2
    Hyperactive Member
    Join Date
    Nov 1999
    Location
    Columbia, SC USA
    Posts
    374
    for entering a date, I wouldn't advise using a textbox. You should use the DateTime Picker. It is already nicely formatted and you don't have to worry about an entry mask or about having all of the "/" in the right places.

  3. #3
    Addicted Member
    Join Date
    Jan 2000
    Location
    Oshkosh, WI
    Posts
    163
    The problem with the date/time picker is that it doesn't allow blank dates without the use of that nasty checkbox.

    I use that date/time picker when I have a default date that I can load into the control initially. Otherwise I live with the limitations of the mask edit box.

    Glenn D
    Development/Analyst

  4. #4
    Hyperactive Member
    Join Date
    Nov 1999
    Location
    Columbia, SC USA
    Posts
    374

    Unhappy

    That's true about the blank field/checkbox issue. One way around it is to add a default date when adding a new record, using the Date(Now) function. It would look something like:

    Code:
    Private Sub AddRecord()
    
    'with the ADO control
    Adodc1.Recordset.AddNew
    Adodc1.Recordset.Fields("DATE") = Date(Now)
    
    'or with an ADODB recordset
    myRS.AddNew
    myRS.Fields("DATE") = Date(Now)
    
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width