problems with Mask edit controls bound to data controls

problems with Mask edit controls bound to data controls

Post by Arnaud Sama » Mon, 28 Aug 1995 04:00:00



To control user's input, I would like use Mask edit.
On my form I have a button, to add a new record, but when VB execute
        Data.recordset.addnew
I have a validation error and after a run-time error, with the empty
field (His mask is ?######), and I can't resume this error.

Somebody has an idea where i'm mistaking (i think it's possible to
add a new records with this control.

        Thank Your for your help

        Arnaud - France - Paris

 
 
 

problems with Mask edit controls bound to data controls

Post by CLogi » Mon, 28 Aug 1995 04:00:00




> Subject: problems with Mask edit controls bound to data controls
> Date: 27 Aug 95 02:54:28 -0700

> Path:

interramp.com!psinntp!psinntp!uunet!in2.uu.net!news.sprintlink.net!news.msn.com!
msn.com

Quote:> Newsgroups: comp.lang.basic.visual.database
> Organization: The Microsoft Network (MSN)
> Lines: 13

> To control user's input, I would like use Mask edit.
> On my form I have a button, to add a new record, but when VB execute
>    Data.recordset.addnew
> I have a validation error and after a run-time error, with the empty
> field (His mask is ?######), and I can't resume this error.

> Somebody has an idea where i'm mistaking (i think it's possible to
> add a new records with this control.

I have discussed this with Microsoft to some extent.  The problem seems to be
with the design and validation using two tools (a kind of a double validation, I
guess...). What I do is this,
1.      Place a text box on the screen properties (Hidden, And bound to your    
        data control.)
2.      Instead of binding the masked box to your data control, do this. on the
        (Lost Focus) make the   text box = the masked box.

hope this helps,
Hawk - Austin, Tx.

>    Thank Your for your help

>    Arnaud - France - Paris



 
 
 

problems with Mask edit controls bound to data controls

Post by John M. Mia » Tue, 29 Aug 1995 04:00:00



Quote:

>To control user's input, I would like use Mask edit.
>On my form I have a button, to add a new record, but when VB execute
>        Data.recordset.addnew
>I have a validation error and after a run-time error, with the empty
>field (His mask is ?######), and I can't resume this error.

>Somebody has an idea where i'm mistaking (i think it's possible to
>add a new records with this control.

The masked edit control that comes with VB is a piece of fecal waste
matter.  I would highly recommend getting a copy of Aware VBX (Far Point)
the controls in that package hanlde the sort of situation you
are describing.

-----------------------------------------------
VisualWare, Inc.
Custom Visual Basic, C++, and Windows Programming
1675 East Main St, Suite 218
Kent OH 44240
(216) 297-4444

-----------------------------------------------

 
 
 

1. Masked Edit Control and Remote data control problem

I have a form with two controls: A Masked Edit control and a Remote data
control. There is also an
"OK" button on the form

I type in data into the Masked Edit control and then click OK (the
program goes to CBlueWhiteFormView::OnSlipOk() function). The data that
I had typed into the masked edit control is fed into the database. But
then I get a dialog box with the message:"No open cursor or cursor
closed". Why do I get this error message? How do I get rid of this error
message?. I am using an ODBC connection to the database.

void CBlueWhiteFormView::OnSlipsOk()
{
 CMSMask* StudentIDBox = (CMSMask*) GetDlgItem(IDC_STUDENT_ID_BOX);
 CRdc* SlipRDC = (CRdc*) GetDlgItem(IDC_SLIP_RDC);
 ASSERT(StudentIDBox != NULL && SlipRDC != NULL);
 if (StudentIDBox != NULL && SlipRDC != NULL)
 {
  SlipRDC->SetDataSourceName(_T("security"));
  SlipRDC->SetCursorDriver(2);

StudentIDBox->BindDefaultProperty(0x16,VT_BSTR,_T("STUDENT_ID"),SlipRDC);

  strStudentID = StudentIDBox->GetText();
  strStudentID = _T("INSERT INTO SLIPTABLE (STUDENT_ID) VALUES ('") +
                 strStudentID + _T("')");

  SlipRDC->SetSql(strStudentID);
  SlipRDC->Refresh();
  //StudentIDBox->Refresh();
 }

2. Informix License

3. Problem with bound DataCombo and Masked Edit controls when changing their contents

4. ORACLE Specialists - Practice Level Managers

5. Bound masked edit controls

6. Copy structure to another table

7. bound masked edit control

8. Technical Support Engineers / Unify Corporation / Sacramento, CA

9. Masked Edit Control do not update entered data ...

10. Masked Edit Control date type problem

11. Masked Edit Control /AddNew Problem

12. Problem with Masked Edit control...

13. Problem with Masked Edit Control