MaskEdBox, clear data field 
Author Message
 MaskEdBox, clear data field

Hi all,

How may I clear an Access data field, who contained a valid data
before. I use VB 4.0 and Access 7.0.

I tried

    If MaskEdBox4.Text = "__.__.____" Then
        MaskEdBox4.Mask = ""
        MaskEdBox4.Text = ""
    End If
    Data1.RecordSet.Update

After this the Access table contains still the old valid data, instead
of an empty field.

Thomas Spiess
http://www.*-*-*.com/



Sun, 04 Jul 1999 03:00:00 GMT  
 MaskEdBox, clear data field
Quote:

> Hi all,

> How may I clear an Access data field, who contained a valid data
> before. I use VB 4.0 and Access 7.0.

> I tried

>     If MaskEdBox4.Text = "__.__.____" Then
>         MaskEdBox4.Mask = ""
>         MaskEdBox4.Text = ""
>     End If
>     Data1.RecordSet.Update

> After this the Access table contains still the old valid data, instead
> of an empty field.

> Thomas Spiess
> http://www.tinet.ch/spiesscouldn't you try an update query?



Sun, 04 Jul 1999 03:00:00 GMT  
 MaskEdBox, clear data field

Thomas,

Aren't you missing:
  Data1.RecordSet.Edit
before your Update?

If you the MaskEdBox is bound to a data control,
you might want to check out the 'UpdateRecord' method.

Hope this helps,

Larry Fee
Systems Division, Corporate and Strategic Programs
Ministry of Health, Victoria  BC  Canada
Phone: (250) 952-1413        Fax..: (250) 952-2308



Quote:
> Hi all,

> How may I clear an Access data field, who contained a valid data
> before. I use VB 4.0 and Access 7.0.

> I tried

>     If MaskEdBox4.Text = "__.__.____" Then
>         MaskEdBox4.Mask = ""
>         MaskEdBox4.Text = ""
>     End If
>     Data1.RecordSet.Update

> After this the Access table contains still the old valid data,
instead
> of an empty field.



Sun, 04 Jul 1999 03:00:00 GMT  
 MaskEdBox, clear data field

Hi Jason,

Quote:
>> couldn't you try an update query?

I could, but it doesn't matter. The old data is still in the access
table, instead of a null value.

The question in a more general way:

How may I clear a field (data format) in an access table within a VB
program?

Thomas Spiess
http://www.tinet.ch/spiess



Tue, 06 Jul 1999 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. clear form field data

2. Clearing RTF data from DAO Meno Field

3. Clearing data fields with DBgrid - Possible??

4. text boxes and maskedbox fields -- arithmetic

5. binding maskedbox with datetime field

6. Binding maskedbox with datetime field

7. How can i clear the MSHFLEXGRID without CLEAR - Como limpar a GRID sem usar CLEAR

8. MaskEdBox Format's property data type

9. clearing fields

10. Clear All Form Fields

11. Can't clear OLE-Object field

12. Modules & Clearing the text fields

 

 
Powered by phpBB® Forum Software