473,700 Members | 2,842 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Capture new record event

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
Feb 11 '07 #1
10 34062
I made an error in my message. 'New record' should be 'Next or Previous
record'.
john

"john" <jo**@test.coms chreef in bericht
news:eq******** ***@textnews.wa nadoo.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

Feb 11 '07 #2
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.

Feb 11 '07 #3
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
Feb 11 '07 #4
the OnCurrent event fires for each
Thanks, that did it, after having found the equivalent in Dutch.
john

"salad" <oi*@vinegar.co mschreef in bericht
news:Y0******** *****@newsread3 .news.pas.earth link.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.


Feb 11 '07 #5
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*********@wo wway.comschreef in bericht
news:g6******** *************** *********@4ax.c om...
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

Feb 11 '07 #6
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
Feb 11 '07 #7
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*********@ho tmail.comschree f in bericht
news:YB******** **********@news svr27.news.prod igy.net...
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

Feb 11 '07 #8
"john" <jo**@test.comw rote in message
news:eq******** ***@textnews.wa nadoo.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
Feb 11 '07 #9
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.OldVa lue 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*********@ho tmail.comschree f in bericht
news:YB******** **********@news svr27.news.prod igy.net...
>>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


Feb 12 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3130
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. say my html form has 3 or 4 or 5 input text boxes, now I want to capture onFocus event for all the text boxes without writing onFocus code in <input> tag.
1
5472
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 which holds several subforms, and the subforms are not editable unless the user clicks the "edit" button within the subform. But I want to lock the subform's textboxes again once the user proceeds to the next record. For some reason I was thinking form_current would work, but it doesn't.
5
4486
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
1
13522
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 maximizing/minimizing a window when it happens. Is there any way to do this? Joy
8
2578
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? Thanks Ken
2
7866
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 give VB5 or VB6 examples which won't code convert upgrade to VB.NET without warnings errors that I can understand how to fix. There's some ActiveX and OCX's floating around, some free some not, but in all cases they don't explain or give me access to the raw PCM data in some kind of familiar...
1
2183
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 instead? I want to use a slider to allow the user to rotate an object on the screen from 0 to 360 degrees. Upon changing the slider the object would rotate. (using Asp.net 2.0, visual studio 2005, vb.net, WinXP Pro SP2)
1
2699
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#
0
8714
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9203
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9060
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7797
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6557
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5897
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4396
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4650
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3082
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.