473,385 Members | 2,005 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Identify the current record number

54
I want my database to open automatically to the last record that was being viewed on a form when it was closed. I was thinking of having the current record number saved to a textbox in a table so that the number could be recalled and I could use the gotorecord command to go there. I don't know how to have access determine and save the current record number to a text box though. Any ideas on how to do this would be lovely. Thanks.
Oct 15 '14 #1

✓ answered by twinnyfo

Use the OnCurrent Event of your form and save the record number to a table, just be sure to use a unique record identifier.

5 3449
twinnyfo
3,653 Expert Mod 2GB
Use the OnCurrent Event of your form and save the record number to a table, just be sure to use a unique record identifier.
Oct 15 '14 #2
Becker
54
Thanks. Also I just found out I can refer to the record as me.currentrecord. I didn't think it would be that easy.
Oct 15 '14 #3
jforbes
1,107 Expert 1GB
You might want to check out: http://allenbrowne.com/ser-18.html
Oct 15 '14 #4
Becker
54
Have you used the code on that site before? I think it looks like exactly what I want to do.

I created the table and pasted the code in but it doesn't work. It says that the field me.customerid could not be found (in the unload event). Is there something else I was supposed to do to make this code work?
Oct 15 '14 #5
NeoPa
32,556 Expert Mod 16PB
If you use code that's been posted then you have to make sure that any field names referred to match the fields you have available. Any other references would have to follow the same basic approach. You cannot generally expect code written to refer to specific items to work in your own system directly unless you know that all references in the original match your own setup that precisely.
Oct 16 '14 #6

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

Similar topics

3
by: Michael Charney | last post by:
I have a form where records are entered. I have turned off the built in record control. I created buttons to advance and go back through the records as well as an add new record button, but I also...
4
by: DBQueen | last post by:
I have a subform which is in Continuous Forms view. I have added a button to the bottom of the page to move to the next record using the button wizard (result: DoCmd.GoToRecord , , acNext). I...
3
by: John Baker | last post by:
Hi: I need to determine if removing a record from a table would leave the table empty, in which case I do not want to permit it. Can someone tell me how I determine the number of records in a...
1
by: Marco Krechting | last post by:
Hi All, I have a continuous form on which I placed an image. Under the click event I want to retrieve the current record number even when the focus is for example set to the first record. I...
0
by: Scott269 | last post by:
So I've got an old MS Works database I imported into Access. I needed a primary key so I created a record number field that was just the record number I manually inserted when I entered it in the...
1
by: Scott269 | last post by:
So I've got an old MS Works database I imported into Access. I needed a primary key so I created a record number field that was just the record number I manually inserted when I entered it in the...
6
by: ven | last post by:
hello i want to get current record in MS SQL table with identity column, let say i put somethin using INSERT INTO and then i want to know current number in identity column how can i put this...
4
by: Julian32 | last post by:
Hello all, I'm using a Gridview control with an Access database as the data source. I created a custom column (Template Field) and am trying to populate it with the row number. Please note that...
5
by: AccessHunter | last post by:
Please Help.. Is it possible to have current record as a column in a query? I have been trying different methods to include current record number as one of the columns in my query, nothing is...
11
by: JHite | last post by:
I'm using MS Access 2003. I have a form named frmClient which has a subform named frmGrantLoan. On frmGrantLoan I have an unbound text box named CRNum. I have the VBA code (shown below) executed by...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...

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.