By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,122 Members | 906 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,122 IT Pros & Developers. It's quick & easy.

Current record in a query

P: 77
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 working. Please help


Thanks in advance
Dec 28 '07 #1
Share this Question
Share on Google+
5 Replies


Minion
Expert 100+
P: 108
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 working. Please help


Thanks in advance
If you're not deleting records from the table you could add an incremental autotext field. This would then count sequentially each time a record is added. However, if you delete records this would be altered and you'd be missing numbers. If this happens an update function could be used to renumber the records.

Is that of any help to you?

- Minion -
Dec 28 '07 #2

jaxjagfan
Expert 100+
P: 254
If it is a new record in the form and hasn't been saved or refreshed then the data that you see is not available in a query. It would need to be saved or refreshed first.

If that doesn't answer your question - What excatly are you trying to do? Give more details on your process.
Dec 28 '07 #3

P: 77
I am doing a query joining couple of tables, all need is to have a column in that query which will be record number. Hope this helps.


Thanks,
Dec 29 '07 #4

nico5038
Expert 2.5K+
P: 3,072
When you have a unique (set of) field(s), you can use a:
DCOUNT("*","Queryname","Uniqueid<=" & [UniqueID])

It will however slow the query down considerably.

Easier to use (and faster) is a report and add an unbound field with a formula:
=[FieldName]+1

Nic;o)
Dec 29 '07 #5

missinglinq
Expert 2.5K+
P: 3,532
In Access the current record number is really a rather abstract concept! As has been pointed out, a given record's
current record number can change from moment to moment, without anything actually being done to that record! The only legitimate use I've seen it put to is displaying an "X Record of Y Records" type message when the Access Nav buttons have been replaced by custom buttons.

Minion and Nico have both made excellent suggestions, depending on your exact needs.

Welcome to TheScripts!

Linq ;0)>
Dec 30 '07 #6

Post your reply

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