* First, you shouldn't be using the IIf function. It has a tendency to
execute both the True and False conditions. Don't Instead, use the If
...Then ...Else with the IsNull function.
* Second, here is a function I use to properly clear the MaskedEditControl
without losing the mask:
Function ClearMaskedEdit (Ctrl as MaskedEditControl)
Dim vM as String
vM = .Mask
.Text = ""
.Mask = vM
* Third, the rest of your questions can be answered by researching the MSDN
>How do I put an empty string into the MaskEdtBox ? eg: ""
>How should I refer to the text on the MaskEdtBox ? txtMask.Text ?
>txtMask.SelText ? txtMask.ClipText ?
>I'm having difficulty to put data into the MaskEdtBox while refering to a
>Set Rst = Db.Openrecordset("MyTable")
>If Not Rst.RecordCount = 0 Then
> txtMask.Text = IIF(IsNull(!Code),"",!Code) <------- what is the best
>approach in this line ?
>If !Code is Null then put an empty string else put the content of the !Code
>And also, while updating the Recordset
> !Code = txtMask.Text <----- should I use ClipText ? SelText ?