If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > Can't clear masked edit control

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-09-03, 16:43
SteveH SteveH is offline
Registered User
 
Join Date: Apr 2002
Location: Illinois
Posts: 133
Can't clear masked edit control

I have an unbound masked edit control with a mask for a social security number. I had code in the click event of a button to clear the SSN but it would only work the first time the button was clicked.

This is the line of code I used:

Me.MaskedEdit1.Text = " / / " (3 spaces, 2 spaces, 4 spaces)

Also tried:
Me.MaskedEdit1.Text = " / / " (same spaces)
Me.MaskedEdit1.Mask = "###/##/####"

And:
Me.MaskedEdit1.Mask = "###/##/####"
Me.MaskedEdit1.Text = " / / " (same spaces)

Any ideas?


Thanks
__________________
SteveH
Reply With Quote
  #2 (permalink)  
Old 05-13-03, 14:54
Ixalmida Ixalmida is offline
Registered User
 
Join Date: Dec 2002
Posts: 11
You need to set the text to null and you don't need to specify the "text" property since it is the default property. The following worked for me when I tried it:

Private Sub Form_Open(Cancel As Integer)
MaskEdBox0 = ""
MaskEdBox0.Mask = "##/##/####"
End Sub
Reply With Quote
  #3 (permalink)  
Old 05-14-03, 17:17
SteveH SteveH is offline
Registered User
 
Join Date: Apr 2002
Location: Illinois
Posts: 133
Didn't work for me

Ixalmida,

Thanks for the reply. For some reason it didn't work for me. I got an error during compile.
__________________
SteveH
Reply With Quote
  #4 (permalink)  
Old 05-15-03, 11:13
Ixalmida Ixalmida is offline
Registered User
 
Join Date: Dec 2002
Posts: 11
Re: Didn't work for me

Hmm...maybe it is a version thing. I was only able to try it in VB5. Then again, you may just have a corrupted component. Who knows?
Reply With Quote
  #5 (permalink)  
Old 05-15-03, 11:15
SteveH SteveH is offline
Registered User
 
Join Date: Apr 2002
Location: Illinois
Posts: 133
Version Thing

You may have a point. I should have mentioned I am using VB.Net.
__________________
SteveH
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On