Problem with Masked Edit Control 6.0

Problem with Masked Edit Control 6.0

Post by Jef » Fri, 21 Jan 2000 04:00:00



I have a couple of Masked Edit Controls on a form.(Purpose: entering dates)
Each of these controls is bound to a field of a Data Control on the form.
The problem I have is when I scroll through the records with
Data1.Recordset.Movenext the Masked Edit Controls aren't always updated
according to what's really in the fields in the underlying table.
I mean that sometimes the dates in the Masked Edit Controls don't change for
let's say 3 records and then at the fourth record it displays the correct
information again, but the previous three records all showed the date of the
first record.
Can anyone give me any advice on this? Is there another way to put an
inputmask on a field without using the Masked Edit Control?

Thanks a lot,

Jef

 
 
 

Problem with Masked Edit Control 6.0

Post by Ray » Sat, 22 Jan 2000 04:00:00


Why don't you use a regular text box and format the text to display the way
you want?  Or if your using a date then I like to use the DateTimePicker
control, but I don't know if your problem will be solved with that.  If not
try putting code in another textbox_change event so that it will activate
the update and/or format of the Date textbox (or DTPicker).

                Hope this helps,
                Ray


Quote:> I have a couple of Masked Edit Controls on a form.(Purpose: entering
dates)
> Each of these controls is bound to a field of a Data Control on the form.
> The problem I have is when I scroll through the records with
> Data1.Recordset.Movenext the Masked Edit Controls aren't always updated
> according to what's really in the fields in the underlying table.
> I mean that sometimes the dates in the Masked Edit Controls don't change
for
> let's say 3 records and then at the fourth record it displays the correct
> information again, but the previous three records all showed the date of
the
> first record.
> Can anyone give me any advice on this? Is there another way to put an
> inputmask on a field without using the Masked Edit Control?

> Thanks a lot,

> Jef


 
 
 

Problem with Masked Edit Control 6.0

Post by Lee Jenkin » Wed, 26 Jan 2000 04:00:00


I like Ray's solution.  The MaskEdit Controls did the same thing with me and
I just replaced them with text boxes


Quote:> I have a couple of Masked Edit Controls on a form.(Purpose: entering
dates)
> Each of these controls is bound to a field of a Data Control on the form.
> The problem I have is when I scroll through the records with
> Data1.Recordset.Movenext the Masked Edit Controls aren't always updated
> according to what's really in the fields in the underlying table.
> I mean that sometimes the dates in the Masked Edit Controls don't change
for
> let's say 3 records and then at the fourth record it displays the correct
> information again, but the previous three records all showed the date of
the
> first record.
> Can anyone give me any advice on this? Is there another way to put an
> inputmask on a field without using the Masked Edit Control?

> Thanks a lot,

> Jef

 
 
 

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. Memory leakages with DAO/Jet and Attached Tables

3. problems with Mask edit controls bound to data controls

4. Microsoft had acquired Fox Software!

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

6. DrWatson in SQLExecutive while replication

7. Masked Edit Control Problem

8. Can I use a variable in CONTAINS predicate instead of column name?

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

10. Problem with Masked Edit control...

11. Masked Edit Control date type problem

12. Problem with Masked Edit Control

13. Masked Edit Control /AddNew Problem