Results 1 to 2 of 2

Thread: Maskedtextbox and the Null

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2008
    Posts
    15

    Maskedtextbox and the Null

    Ok I found one page here that talks about it but I am at wits end. For what I am doing I pretty much need 5 maskedtextboxes showing 24-hour time. Using VB2008.

    If a time is entered into the box it cannot be removed. If the user removes the time from the box they will be stuck with focus on that maskedtextbox until they put in another time.

    The SQL server is set to allow null and the dataset parameters also show nulls allowed. Any ideas on a way to allow an empty maskedtextbox to be returned to the server.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: Maskedtextbox and the Null

    Don't use a MaskedTextBox for dates or times. Use a DateTimePicker. Set the Format to Custom and the CustomFormat to "HH:mm". You should also set ShowUpDown to True.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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