Continuous Forms Question

  • Thread starter Thread starter Anatoly Kurilin
  • Start date Start date
A

Anatoly Kurilin

Hi, I have two similar subforms connected to two different tables. Each
subform has a textbox control. I have to check its contents in the event
BeforeUpdate. So, when a NEW RECORD is created, the first subform behaves
quite normal: after the message, I run command Cancel = True and if the user
presses Escape button, the textbox gets empty. But the second subform
behaves in a bit different way: when the user presses Escape button, the
whole content of that textbox just gets marked, giving the way to move to
the next control by pressing Tab and passing the checkup. What's wrong with
the second subform? Actually they are twins...

Thanks in advance,
AK



__________ Information from ESET NOD32 Antivirus, version of virus signature database 5113 (20100513) __________

The message was checked by ESET NOD32 Antivirus.

http://www.esetnod32.ru/.ml
 
I'm talking about the control's Before Update event.

BruceM via AccessMonster.com said:
Details needed. You mention a message, an Escape button, and Cancel =
True,
but without seeing the code there is no context. Also, which Before
Update
event are you talking about: the form or the control?



--



__________ Information from ESET NOD32 Antivirus, version of virus
signature database 5115 (20100514) __________

The message was checked by ESET NOD32 Antivirus.

http://www.esetnod32.ru/.ml



__________ Information from ESET NOD32 Antivirus, version of virus signature database 5115 (20100514) __________

The message was checked by ESET NOD32 Antivirus.

http://www.esetnod32.ru/.ml
 
Private Sub txtMasterField_BeforeUpdate(Cancel As Integer)
If gCustomerInitials(txtMasterField.Value, True) = "" Then
Cancel = True
End If
End Sub


BruceM via AccessMonster.com said:
What code is in the control's Before Update event?

Anatoly said:
I'm talking about the control's Before Update event.
Details needed. You mention a message, an Escape button, and Cancel =
True,
[quoted text clipped - 23 lines]

__________ Information from ESET NOD32 Antivirus, version of virus
signature database 5115 (20100514) __________

The message was checked by ESET NOD32 Antivirus.

http://www.esetnod32.ru/.ml

--
Message posted via AccessMonster.com



__________ Information from ESET NOD32 Antivirus, version of virus
signature database 5115 (20100514) __________

The message was checked by ESET NOD32 Antivirus.

http://www.esetnod32.ru/.ml



__________ Information from ESET NOD32 Antivirus, version of virus signature database 5115 (20100514) __________

The message was checked by ESET NOD32 Antivirus.

http://www.esetnod32.ru/.ml
 
To make the investigation easier, I've changed the code but of no avail ...
Private Sub txtMasterField_BeforeUpdate(Cancel As Integer)

If Len(txtMasterField.Value) > 10 Then
Beep
Cancel = True
End If

End Sub


BruceM via AccessMonster.com said:
OK, what is gCustomerInitials? Seems to be a user-defined function, but
what
is its code?

Anatoly said:
Private Sub txtMasterField_BeforeUpdate(Cancel As Integer)
If gCustomerInitials(txtMasterField.Value, True) = "" Then
Cancel = True
End If
End Sub
What code is in the control's Before Update event?
[quoted text clipped - 12 lines]

__________ Information from ESET NOD32 Antivirus, version of virus
signature database 5115 (20100514) __________

The message was checked by ESET NOD32 Antivirus.

http://www.esetnod32.ru/.ml

--
Message posted via AccessMonster.com



__________ Information from ESET NOD32 Antivirus, version of virus
signature database 5115 (20100514) __________

The message was checked by ESET NOD32 Antivirus.

http://www.esetnod32.ru/.ml



__________ Information from ESET NOD32 Antivirus, version of virus signature database 5115 (20100514) __________

The message was checked by ESET NOD32 Antivirus.

http://www.esetnod32.ru/.ml
 
As a matter of fact, I limited the length of the entry as an example of any
cancelled action. And I don't want to remove the entry - user has to see
what he/she entered. All I want is to make the control to behave in a proper
way - there mustn't be any way to bypass the command Cancel = True.

BruceM via AccessMonster.com said:
It seems that if the length of the entry in the field is greater than 10
characters you want to cancel the entry. Why not just limit the field
size
to 10 characters? Anyhow, if you want to remove the entry you need to
add:
Me.txtMasterField.Undo

Anatoly said:
To make the investigation easier, I've changed the code but of no avail
...

Private Sub txtMasterField_BeforeUpdate(Cancel As Integer)

If Len(txtMasterField.Value) > 10 Then
Beep
Cancel = True
End If

End Sub
OK, what is gCustomerInitials? Seems to be a user-defined function, but
what
[quoted text clipped - 18 lines]

__________ Information from ESET NOD32 Antivirus, version of virus
signature database 5115 (20100514) __________

The message was checked by ESET NOD32 Antivirus.

http://www.esetnod32.ru/.ml

--
Message posted via AccessMonster.com



__________ Information from ESET NOD32 Antivirus, version of virus
signature database 5115 (20100514) __________

The message was checked by ESET NOD32 Antivirus.

http://www.esetnod32.ru/.ml



__________ Information from ESET NOD32 Antivirus, version of virus signature database 5115 (20100514) __________

The message was checked by ESET NOD32 Antivirus.

http://www.esetnod32.ru/.ml
 
No, it does not!

BruceM via AccessMonster.com said:
So you're saying that in your most recent example if the user makes an
entry
of greater than 10 characters the code doesn't stop them?

Anatoly said:
As a matter of fact, I limited the length of the entry as an example of
any
cancelled action. And I don't want to remove the entry - user has to see
what he/she entered. All I want is to make the control to behave in a
proper
way - there mustn't be any way to bypass the command Cancel = True.
It seems that if the length of the entry in the field is greater than 10
characters you want to cancel the entry. Why not just limit the field
[quoted text clipped - 27 lines]

__________ Information from ESET NOD32 Antivirus, version of virus
signature database 5115 (20100514) __________

The message was checked by ESET NOD32 Antivirus.

http://www.esetnod32.ru/.ml

--
Message posted via AccessMonster.com



__________ Information from ESET NOD32 Antivirus, version of virus
signature database 5115 (20100514) __________

The message was checked by ESET NOD32 Antivirus.

http://www.esetnod32.ru/.ml



__________ Information from ESET NOD32 Antivirus, version of virus signature database 5115 (20100514) __________

The message was checked by ESET NOD32 Antivirus.

http://www.esetnod32.ru/.ml
 
Back
Top