If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Continuous Forms Question
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 |
#2
|
|||
|
|||
Continuous Forms Question
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? Anatoly Kurilin wrote: 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 -- Message posted via http://www.accessmonster.com |
#3
|
|||
|
|||
Continuous Forms Question
What code is in the control's Before Update event?
Anatoly Kurilin wrote: 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] 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 -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/201005/1 |
#4
|
|||
|
|||
Continuous Forms Question
I'm talking about the control's Before Update event.
"BruceM via AccessMonster.com" u54429@uwe wrote in message news:a7fd10bb9be30@uwe... 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? Anatoly Kurilin wrote: 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 -- Message posted via http://www.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 |
#5
|
|||
|
|||
Continuous Forms Question
OK, what is gCustomerInitials? Seems to be a user-defined function, but what
is its code? Anatoly Kurilin wrote: 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] 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 -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/201005/1 |
#6
|
|||
|
|||
Continuous Forms Question
Private Sub txtMasterField_BeforeUpdate(Cancel As Integer) If gCustomerInitials(txtMasterField.Value, True) = "" Then Cancel = True End If End Sub "BruceM via AccessMonster.com" u54429@uwe wrote in message news:a80008d538ef4@uwe... What code is in the control's Before Update event? Anatoly Kurilin wrote: 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] 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 -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/201005/1 __________ 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 |
#7
|
|||
|
|||
Continuous Forms Question
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 Kurilin wrote: 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] 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 -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/201005/1 |
#8
|
|||
|
|||
Continuous Forms Question
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 Kurilin wrote: 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] 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 -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/201005/1 |
#9
|
|||
|
|||
Continuous Forms Question
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" u54429@uwe wrote in message news:a800b4b0d9340@uwe... OK, what is gCustomerInitials? Seems to be a user-defined function, but what is its code? Anatoly Kurilin wrote: 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] 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 -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/201005/1 __________ 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 |
#10
|
|||
|
|||
Continuous Forms Question
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" u54429@uwe wrote in message news:a801471a84590@uwe... 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 Kurilin wrote: 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] 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 -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/201005/1 __________ 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 |
|
Thread Tools | |
Display Modes | |
|
|