In a form, when you arrive in a new record, what event is trigerred and in
which object? I can't find such an event. I need to reset a value when the
user arrives in a next record.
Thanks,
john 10 33860
I made an error in my message. 'New record' should be 'Next or Previous
record'.
john
"john" <jo**@test.comschreef in bericht
news:eq***********@textnews.wanadoo.nl...
In a form, when you arrive in a new record, what event is trigerred and in
which object? I can't find such an event. I need to reset a value when
the user arrives in a next record.
Thanks,
john
john wrote:
In a form, when you arrive in a new record, what event is trigerred and in
which object? I can't find such an event. I need to reset a value when the
user arrives in a next record.
Thanks,
john
If I am in a form and I press the navigation button to move to a new
record, I can check for the record's state by asking
If Me.NewRecord Then
When you go to any bound form record (form is associated with a
table/query in the recordsource), the OnCurrent event fires for each
record regardless whether it is a new or existing record.
john wrote:
>In a form, when you arrive in a new record, what event is trigerred and in which object? I can't find such an event. I need to reset a value when the user arrives in a next record.
The Current event fires whenever the current record changes.
The form's NewRecord property will indicate if the current
record is a new record.
Sub Form_Current()
If Me.NewRecord Then
'just arrived at a new record
Else
'arrived at an existing record
End If
--
Marsh
the OnCurrent event fires for each
Thanks, that did it, after having found the equivalent in Dutch.
john
"salad" <oi*@vinegar.comschreef in bericht
news:Y0*************@newsread3.news.pas.earthlink. net...
john wrote:
>In a form, when you arrive in a new record, what event is trigerred and in which object? I can't find such an event. I need to reset a value when the user arrives in a next record. Thanks, john
If I am in a form and I press the navigation button to move to a new
record, I can check for the record's state by asking
If Me.NewRecord Then
When you go to any bound form record (form is associated with a
table/query in the recordsource), the OnCurrent event fires for each
record regardless whether it is a new or existing record.
Thanks for the explanation.
I have one more additional question:
Before moving to another record or exiting the form I would like to do a
check on certain fields and prompt the user for a question (Yes/No) whether
to proceed leaving the current record or do something in code in stead and
cancel the 'leave'-action.
In which event should I do that check and how would I cancel leaving the
record?
Thanks,
john
"Marshall Barton" <ma*********@wowway.comschreef in bericht
news:g6********************************@4ax.com...
john wrote:
>>In a form, when you arrive in a new record, what event is trigerred and in which object? I can't find such an event. I need to reset a value when the user arrives in a next record.
The Current event fires whenever the current record changes.
The form's NewRecord property will indicate if the current
record is a new record.
Sub Form_Current()
If Me.NewRecord Then
'just arrived at a new record
Else
'arrived at an existing record
End If
--
Marsh
john wrote:
Thanks for the explanation.
I have one more additional question:
Before moving to another record or exiting the form I would like to
do a check on certain fields and prompt the user for a question
(Yes/No) whether to proceed leaving the current record or do
something in code in stead and cancel the 'leave'-action.
In which event should I do that check and how would I cancel leaving
the record?
Sorry, there is no such event. The current event fires "after you arrive" at a
record. There is no corresponding event for "before you leave" a record.
However; if the checking you want to do only needs to happen on a record they
have changed then the BeforeUpdate event is what you should use and that can be
cancelled to prevent saving a record that doesn't pass all your testing.
--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Thanks. This was the idea:
1. I have about 13 fields that are used for input for an address label.
2. There's a button that automatically formats the whole label, based on the
13 fields, and stores it in an addditional field, so that user can adjust it
when that's necessary.
3. When a user changes one of the 13 fields a hidden unbound field named
'changed' is set to True.
4. When the user leaves the record I would like to tell him that the data
has changed and ask him if he wants to (re-)format the label or not.
Is that somehow possible?
john
"Rick Brandt" <ri*********@hotmail.comschreef in bericht
news:YB******************@newssvr27.news.prodigy.n et...
john wrote:
>Thanks for the explanation.
I have one more additional question: Before moving to another record or exiting the form I would like to do a check on certain fields and prompt the user for a question (Yes/No) whether to proceed leaving the current record or do something in code in stead and cancel the 'leave'-action.
In which event should I do that check and how would I cancel leaving the record?
Sorry, there is no such event. The current event fires "after you arrive"
at a record. There is no corresponding event for "before you leave" a
record. However; if the checking you want to do only needs to happen on a
record they have changed then the BeforeUpdate event is what you should
use and that can be cancelled to prevent saving a record that doesn't pass
all your testing.
--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
"john" <jo**@test.comwrote in message
news:eq***********@textnews.wanadoo.nl...
Thanks. This was the idea:
1. I have about 13 fields that are used for input for an address label.
2. There's a button that automatically formats the whole label, based on the
13 fields, and stores it in an addditional field, so that user can adjust it
when that's necessary.
3. When a user changes one of the 13 fields a hidden unbound field named
'changed' is set to True.
4. When the user leaves the record I would like to tell him that the data has
changed and ask him if he wants to (re-)format the label or not.
Is that somehow possible?
john
Is this a bound form? If it is then you would just use BeforeUpdate event and
eliminate the hidden control. Access already knows when a record in a bound
form has been changed.
--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
john wrote:
Thanks. This was the idea:
1. I have about 13 fields that are used for input for an address label.
2. There's a button that automatically formats the whole label, based on the
13 fields, and stores it in an addditional field, so that user can adjust it
when that's necessary.
3. When a user changes one of the 13 fields a hidden unbound field named
'changed' is set to True.
4. When the user leaves the record I would like to tell him that the data
has changed and ask him if he wants to (re-)format the label or not.
Is that somehow possible?
john
Besides what others have mentioned, if the form is bound to a
table/query, you can look at the OldValue property.
Let's say when you enter the record the value is 10. You change it to
20. You could check via
If Me.Test1.Value <Me.Test1.OldValue then
Usually things are done in the form's BeforeUpdate event when you need
to stop the record updating to new values being entered by setting
Cancel to True.
>
"Rick Brandt" <ri*********@hotmail.comschreef in bericht
news:YB******************@newssvr27.news.prodigy.n et...
>>john wrote:
>>>Thanks for the explanation.
I have one more additional question: Before moving to another record or exiting the form I would like to do a check on certain fields and prompt the user for a question (Yes/No) whether to proceed leaving the current record or do something in code in stead and cancel the 'leave'-action.
In which event should I do that check and how would I cancel leaving the record?
Sorry, there is no such event. The current event fires "after you arrive" at a record. There is no corresponding event for "before you leave" a record. However; if the checking you want to do only needs to happen on a record they have changed then the BeforeUpdate event is what you should use and that can be cancelled to prevent saving a record that doesn't pass all your testing.
-- Rick Brandt, Microsoft Access MVP Email (as appropriate) to... RBrandt at Hunter dot com
Rick, Salad,
Indeed it's a bound form and I thought the form's beforeUpdate would trigger
after every field's update which is not what I want. Now it works like a
charm!
Thanks a lot,
john
"Rick Brandt" <ri*********@hotmail.comschreef in bericht
news:8h******************@newssvr27.news.prodigy.n et...
"john" <jo**@test.comwrote in message
news:eq***********@textnews.wanadoo.nl...
>Thanks. This was the idea: 1. I have about 13 fields that are used for input for an address label. 2. There's a button that automatically formats the whole label, based on the 13 fields, and stores it in an addditional field, so that user can adjust it when that's necessary. 3. When a user changes one of the 13 fields a hidden unbound field named 'changed' is set to True. 4. When the user leaves the record I would like to tell him that the data has changed and ask him if he wants to (re-)format the label or not. Is that somehow possible? john
Is this a bound form? If it is then you would just use BeforeUpdate event
and eliminate the hidden control. Access already knows when a record in a
bound form has been changed.
--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Paresh Shah |
last post by:
Hi Friends...
I have an query on how to capture onFocus event for all the input
controls without writing onFocus event in the <input> tag.
...
|
by: entellisys |
last post by:
Hi there,
Does anyone know the simplest way I can trap the next record event in Access
2000 on a subform?
I have a main form with tab control...
|
by: Uma Muthu |
last post by:
Hello Everyone,
How can I capture the event of closing the IE browser from within an ASP.NET
web application?
TIA,
Uma
|
by: simchajoy2000 |
last post by:
Hi,
I know how to find out what the window state of a vb.net form is
programmatically, but I want to be able to capture the event of...
|
by: Ken Sturgeon |
last post by:
I have a button inside a panel control. Apparently I can't expect VB to
respond to the button's _Click event. How do I capture the click event?
...
|
by: positivebalance41m |
last post by:
I have been searching how to do sound capture (record audio input) in
VB.NET for days now.
I find some references to "winmm.dll" calls, but they...
|
by: Mel |
last post by:
Anyone know how to capture an event when the slider changes? Is this
possible with this control or is there a different control I should
consider...
|
by: anil |
last post by:
I want to capture key down event in the window service and open a new
app when the user press F7. Is there any solution available in C#
|
by: teenabhardwaj |
last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
|
by: Kemmylinns12 |
last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
|
by: CD Tom |
last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
|
by: jalbright99669 |
last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
|
by: Matthew3360 |
last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
|
by: AndyPSV |
last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
|
by: Arjunsri |
last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
|
by: WisdomUfot |
last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
|
by: Matthew3360 |
last post by:
Hi,
I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
| |