Problem using MaskEdtBox 
Author Message
 Problem using MaskEdtBox

* 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
    With Ctrl
    vM = .Mask
    .Text = ""
    .Mask = vM
    End With
    End Function

* Third, the rest of your questions can be answered by researching the MSDN
Library.

Mark Freeman
MCSE,MCT,MCP-VB6,A+

Quote:

>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
>recordset

>Example :

>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 ?
>End If

>If !Code is Null then put an empty string else put the content of the !Code

>And also, while updating the Recordset
>Example:

>  !Code = txtMask.Text   <----- should I use ClipText ? SelText ?

>Thanks



Sun, 27 Jan 2002 03:00:00 GMT  
 Problem using MaskEdtBox
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
recordset

Example :

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 ?
End If

If !Code is Null then put an empty string else put the content of the !Code

And also, while updating the Recordset
Example:

  !Code = txtMask.Text   <----- should I use ClipText ? SelText ?

Thanks



Mon, 28 Jan 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Problem using MaskEdtBox

2. Problem using datatable.select using multiple columns

3. Problem using Crystal report ActiveX installed with VB and used in VC.

4. Problem using VB to retrieve ASP/XML using ADO recordset

5. Problems using SHAPE command when building Database connection string using UDL File

6. Using types in a different assembly given that the type may be used or not used

7. Problem using Openrecordset

8. problems using Date() function

9. Problem using DSum() function

10. Using DAO to create pass thru queries in access 2000 - references problem

11. Problem with using DAO in Excel

12. Problem using DoCmd to copy from one .mdb to another

 

 
Powered by phpBB® Forum Software