473,788 Members | 2,707 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to find out if I'm standing on a new record row in a form?

176 New Member
Hi everyone.

For a coding of something which seem too long to explain, I need to find out, by .recordset or any other way, whether or not I (the user) am standing on the new record row in a form.

I've checked .EOF, but it gives me 'False'. I also have checked .AbsolutePositi on but it gives me the record number of the last record I was standing on.

Maybe there's some other way, or other property of .recordset I'm not aware about that can distinct the new record row?

Thanks a lot,
Michael.
Sep 27 '08 #1
4 2105
DonRayner
489 Recognized Expert Contributor
You could catch the "me.recordset.r ecordcount" value into a form global variable in the forms "On Open" event. Then check your variable against the the current "me.recordset.r ecordcout" value in the forms "On Current" event.

Personally I would make it impossible for a user to get to a new record unless it was through a control that I placed on the form.
Sep 27 '08 #2
ADezii
8,834 Recognized Expert Expert
  1. If you are at a New Record on a Form, then the Me.NewRecord Statement will evaluate to True in the Form's Current() Event.
  2. After you invoke the AddNew() Method on a Recordset, the AbsolutePositio n Property of the Recordset will evaluate to -1.
Sep 28 '08 #3
NeoPa
32,579 Recognized Expert Moderator MVP
Me.NewRecord is the simple answer.

It's hard to find (I keep losing it and struggling to find it again), as it's relative to Me rather than relative to the more intuitive Me.Recordset.
Sep 29 '08 #4
Michael R
176 New Member
Thanks so much, Me.NewRecord works great!
Sep 30 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
7881
by: Jonathan | last post by:
Hi all! For a match schedule I would like to find all possible combinations of teams playing home and away (without teams playing to themselves of course). I now the simple version works something like this: For a (very) simple table containing three rows like this: row 1: A
5
3747
by: HJ | last post by:
Hi all, Consider an Access 2002 run-time application on Windows XP. The controls on a form are locked until the user clicks an Edit button. The form is based on a query and all controls are bound.
3
6225
by: Randy | last post by:
I have been able to set up a Find Record Button on my switchboard to take me to a form with the correct case number by using a parameter query and macro. When I try to run the Find Record button from the macro on the form I want to find the record in it just sits there and does not run. Could someone tell me how to fix this? Please be specific as I am new to Access.
1
1851
by: AA Arens | last post by:
I use the undermentioned code to find a record in a predefined "Look In" field: Private Sub Command137_Click() On Error GoTo Err_Find_Record_Click Me.CompanyName.SetFocus DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70 Exit_Find_Record_Click: Exit Sub Err_Find_Record_Click:
11
8420
bhcob1
by: bhcob1 | last post by:
Hi, Whenever I delete a record my command button, the record deletes, a list displaying all records is updated and then a message box appears: Microsoft Access can't find the field 'I' referred to in your expression It only has the option of clicking 'OK', when I do this everything is fine again. I would like to know what is going on and how to fix this problem. Below is parts of the code that I believe the problem is in. The form is...
7
4540
by: john | last post by:
In my form I have a master table and a details table linked 1xM. I can search through the whole parent table but I also like to be able to search through the child table fields to find parent records. Should I design a new form for this or can I somehow make this work in the same form. Thanks in advance, john
1
18250
by: Simon | last post by:
Dear reader, How can I find a record in a sub form, the sub form type is DataSheet and the record collection in the subform are to many to show them all in the subform window.
1
2574
by: farhan31 | last post by:
Hello all I have Two tables.Table 1 and table 2.Table 1 has one to many relation with Table 2.I have one main form Form1 based on table 1.On form 1 i have a sub form based on table 2.I have put a find record button on main form i.e Form 1.Master/child relation is already established.Find button works fine with main form.it changes the main form entries and the sub form entries accordingly.this button doesnot work with sub form.this means that...
1
3331
Run2Eat
by: Run2Eat | last post by:
i feel like this is a doofus question... but i've created an access form and added a find record button, but when i use the form, the find record button searches the form itself, not the table. all the other buttons work, so i believe the form is linked to the table. how can i get the find record button to search the table, not the form itself?
0
10370
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...
1
10113
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9969
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6750
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
5402
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
5538
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4074
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
2
3677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2896
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.