masked Edit Control Problem

masked Edit Control Problem

Post by Edward Palli » Tue, 29 Dec 1998 04:00:00



Greetings,

I am quite new to Visual Basic 5.0(And programmng in general) and am
having the following problem.

I have a masked edit box control on my form.  The masked control is
bound to a data control and the data control is bound to an MS Access 97
table.  The masked control is looking at a date field in the Access
table.

I set up the input mask as ##/##/#### to only accept numbers.  After the
focus is lost, I use IsDate on the entered text to ensure that a valid
dat is entered.  Now, in order for IsDate to work correctly, I must set
the PromptInclude value to True in order for the text value to retain
the literals(ie - 10/20/1998 as opposed to 10201998).

So, everything seems to work fine, however, when I use the Date Control
to move to the next record and that next record is null, the date
entered on the previous record is "carried over" on the masked edit
control.

This is really strange, and I can't seem to find the problem.  It all
seems linked to the PromptInclude property of the masked edit control.

If anyone is willing to help me on this, it would be greatly
appreciated.  If necessary, I could e-mail the database and the vb
project if that would make troubleshooting this easier.

Thanks in advance.

 
 
 

masked Edit Control Problem

Post by Jim » Tue, 29 Dec 1998 04:00:00


I have seen the same thing. You will have to turn off the PromptInclude
and format the string before you test for a valid date. also, you will
have to format the string before any printing. This is the only way I
have been able to get it to work.

Jim Fouch
FOUCH SOFTWARE


> Greetings,

> I am quite new to Visual Basic 5.0(And programmng in general) and am
> having the following problem.

> I have a masked edit box control on my form.  The masked control is
> bound to a data control and the data control is bound to an MS Access 97
> table.  The masked control is looking at a date field in the Access
> table.

> I set up the input mask as ##/##/#### to only accept numbers.  After the
> focus is lost, I use IsDate on the entered text to ensure that a valid
> dat is entered.  Now, in order for IsDate to work correctly, I must set
> the PromptInclude value to True in order for the text value to retain
> the literals(ie - 10/20/1998 as opposed to 10201998).

> So, everything seems to work fine, however, when I use the Date Control
> to move to the next record and that next record is null, the date
> entered on the previous record is "carried over" on the masked edit
> control.

> This is really strange, and I can't seem to find the problem.  It all
> seems linked to the PromptInclude property of the masked edit control.

> If anyone is willing to help me on this, it would be greatly
> appreciated.  If necessary, I could e-mail the database and the vb
> project if that would make troubleshooting this easier.

> Thanks in advance.


 
 
 

1. Masked Edit Control Problem

Im currently using the masked edit control to input date information into a
database using the following mask ##/##/## with a format of DD/MM/YY

Ive been able to get the masked edit to save input into an access  database
but only if I change the database field from a "Date" field to a "text"
field as the date is being saved without the "/" character (i.e. 250502 for
25/05/02) so if I leave the field as a date field the program bombs.

So how do I get my "/" character back ? Is there a property of the masked
edit control that can do this for me ?. Is it done in code ?
Or is it done some other way I dont know about ??????

Any help is greatly appreciated

Regards

T on Y

2. Store procedures

3. problems with Mask edit controls bound to data controls

4. BTrieve vs MSJet

5. Masked Edit Control and Remote data control problem

6. pgsql/src/backend/utils/fmgr (README)

7. Masked Edit Control date type problem

8. Challenging: The Code

9. Problem with Masked Edit Control 6.0

10. Masked Edit Control /AddNew Problem

11. Problems with the Masked Edit control in VB4.0

12. Problem with Masked Edit control...

13. Problem with Masked Edit Control