Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display form starting with biggest number

Status
Not open for further replies.

dalex17

Technical User
Jul 14, 2002
96
US
I would like to know how I can make Acess start with the biggest number each time a form is open.

FYI - The form has a ticket number and some details. When the form opens each time, I want the record with the biggest ticket number to display first.

Dalex17
 
use the on_load event to open the dataset as a clone. Then find the max value - or any value and do a:

me.bookmark = rs.bookmark

where rs is the clone recordset.


rollie@bwsys.net

if you wish a sample email and describe this thread.
 
dalex17 --

Questions
---------
Are these tickets deleted upon "completion" or is there a method of storing completion?

If you simply open a form with a recordset set to last record - and the ticket is deleted when done- easy!

However, there will be further if this isn't the case.

Maybe not the simplist, but what I'd do is do a SQL string and ADO

example:
Code:
SELECT blah
FROM table
Where tblName.complete = No
ORDER BY tblName.ticket DESC;
then open the form using the record.
Code:
rst.open SQL
rst.movefirst

doCmd.open formname,,,"ticket=" & rst!ticket

Let me know if you want me to expand on this.. or if this is ridiculously not what you're looking for! :)


Trevor
 
Thanks for the replies.

I have to say that I found your response helpful, but it might be too much of a solution for me.

My question is actually very simple. I just have a table of data that is sorted numerically in ascending order. I just want to be able to show the last record that was entered each time I open the form.

Would it be something as simple as record select = max number (I guess the code or filter would look something like that :0)

thanks,

dalex
 
ehh.. then just do this:

onLoad()
Code:
DoCmd.GoToRecord , , acLast
 
Yes..that did it! Thanks.

(Sorry if I confused you earlier).

Hey, since your good with easy questions :)0), how's about a way to maximise the screen of the form each time it a user opens it?

Thank again for your help on my "load last" issue.

dalex
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top