DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 9 of 9

Thread: Problem in setting the text in MaskEDBox

  1. #1
    Join Date
    Aug 2004
    Posts
    43,023

    Problem in setting the text in MaskEDBox

    [Originally posted by anitha]

    Hi,
    Iam using MaskEdBox in a VB6.0 project. Having problem setting the text retrieved from the database.
    I tried the following

    sTmp = txtDate.Mask
    txtDate.Mask = ""
    txtDate.Text = CStr(otemp.dDate)
    txtDate.Mask = sTmp

    When I execute , it displays "__/__/____" even though the date value is not empty.

    Please help..

    Thanks..

    Anitha

  2. #2
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Problem in setting the text in MaskEDBox

    [Originally posted by neophile]

    Maybe try this?...


    txtDate.Text = Format(otemp.dDate, "mm/dd/yyyy")

  3. #3
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Problem in setting the text in MaskEDBox

    [Originally posted by sanjay]

    sk = MaskEdBox1.Mask
    MaskEdBox1.Mask = ""
    MaskEdBox1.Text = Format(your record, "dd/mm/yyyy")
    MaskEdBox1.Mask = sk

    it should work

  4. #4
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Problem in setting the text in MaskEDBox

    [Originally posted by neophile]

    I don't think you need to do anything with the Mask property... if you pass the Text property a correctly-formatted string, it shouldn't give you any error. The error gets raised as a form of auto-validation.

  5. #5
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Re:Problem in setting the text in MaskEDBox

    [Originally posted by anitha]

    Thanks for all the reply...
    Yes you are right...I did not change the mask just formatted the string and assigned to the Text property.

    Thanks again for the help.

    Anitha

  6. #6
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Problem in setting the text in MaskEDBox

    [Originally posted by Vishwanath]

    hai! I understood ur problem. U r converting the retrieved value into a string and then placing into the masked edit text box. U r specifying the masked control to accept only date values that to in the specified format. so that is not possible to insert a string. Send me ur complete code. I will make the corrections and resend u

    Hope this may be helpful to u.

    kayviess@indiatimes.com

  7. #7
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Problem in setting the text in MaskEDBox

    [Originally posted by Vishwanath]

    hai! I understood ur problem. U r converting the retrieved value into a string and then placing into the masked edit text box. U r specifying the masked control to accept only date values that to in the specified format. so that is not possible to insert a string. Send me ur complete code. I will make the corrections and resend u

    Hope this may be helpful to u.

    kayviess@indiatimes.com

  8. #8
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Problem in setting the text in MaskEDBox

    [Originally posted by Vishwanath]

    hai! I understood ur problem. U r converting the retrieved value into a string and then placing into the masked edit text box. U r specifying the masked control to accept only date values that to in the specified format. so that is not possible to insert a string. Send me ur complete code. I will make the corrections and resend u

    Hope this may be helpful to u.

    kayviess@indiatimes.com

  9. #9
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Re:Problem in setting the text in MaskEDBox

    [Originally posted by anitha]

    Hi Vishwanath,
    I fixed the problem...by formatting the text correctly an then assigned to the text property.
    Thanks..
    Anitha

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center