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 > maintain input mask while clearing fields

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-22-02, 08:17
aotc2002 aotc2002 is offline
Registered User
 
Join Date: Aug 2002
Posts: 10
Question maintain input mask while clearing fields

Problem: Maskedbox input mask lost on clearing of fields

Hello, im trying to figure out how to maintain my input mask after i clear the masked box,
using this:

<code>
frmenterdata.MaskEdBox1.Mask = ""
frmenterdata.MaskEdBox1.Text = ""

frmenterdata.MaskEdBox2.Mask = ""
frmenterdata.MaskEdBox2.Text = ""
</code>

It loses its input mask once i press my data enter button which uses the following code:

<code>

Private Sub cmdenterdata_Click()
Dim dataenter As String


'Built-in method to add a new record
Adodc1.Recordset.AddNew

'clears all fields
clear

'clears fields that didnt clear the first time
chkditch = "0"
chkmv = "0"
chkrip = "0"
chkculverts = "0"
chkBridges = "0"
chkbufferzones = "0"

'disables enterdatabutton, the reason is: if this button is pressed twice
'an error will occur, so the error is caught before it occurs
cmdenterdata.Enabled = False

'Message Prompt
dataenter = MsgBox("Please enter the data in the blank fields provided, once finished use the navigation buttons to confirm the data has been entered", vbInformation + vbOKOnly, "Data Entry Instructions")

frmenterdata.MaskEdBox1.Mask = "##/##/##"
frmenterdata.MaskEdBox2.Mask = "####-##-###"

End Sub

</code>


Note: the 2 MaskedBox's are linked to my data control

Anyone have any solutions on how i can maintain my input masks while still clearing my fields??

Thanks in advance
Reply With Quote
  #2 (permalink)  
Old 08-22-02, 21:01
rnealejr rnealejr is offline
Registered User
 
Join Date: Feb 2002
Posts: 2,232
Just reapply the mask property after you have cleared the mask/text
Reply With Quote
  #3 (permalink)  
Old 08-23-02, 08:53
Sef Sef is offline
Registered User
 
Join Date: Aug 2002
Location: Kampala, Uganda - East Africa
Posts: 13
Exclamation LOSS of mask after entering data!!!

I have the same problem. Has anyone givrn u a solution?
Reply With Quote
  #4 (permalink)  
Old 08-23-02, 10:25
rnealejr rnealejr is offline
Registered User
 
Join Date: Feb 2002
Posts: 2,232
Sef,

After entering data or deleting data ?
Reply With Quote
  #5 (permalink)  
Old 08-23-02, 10:27
aotc2002 aotc2002 is offline
Registered User
 
Join Date: Aug 2002
Posts: 10
Lightbulb Solution?

Try something like this:

<code>
frmenterdata.MaskEdBox1.Mask = " / / " '<--- " 2 spaces / 2 spaces / 2 spaces "
frmenterdata.MaskEdBox1.Text = " / / " '<--- " 2 spaces / 2 spaces / 2 spaces "


frmenterdata.MaskEdBox2.Mask = " - - " '<--- " 4 spaces / 2 spaces / 3 spaces"
frmenterdata.MaskEdBox2.Text = " - - " '<--- " 4 spaces / 2 spaces / 3 spaces"

</code>
Reply With Quote
  #6 (permalink)  
Old 08-23-02, 10:28
aotc2002 aotc2002 is offline
Registered User
 
Join Date: Aug 2002
Posts: 10
solution?

The above code is in my clearing method, so far it works!
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