Open Form in last Category or record

S

Steve Schapel

Lmv,

I no longer have the database you sent before. You can email me your
latest version if you like. I am not able to use the other email
address you used before at the moment. This time send it to:
steves <at> mvps <dot> org
 
S

Steve Schapel

Lmv,

You copy/pasted the suggested SQL for the qryLatestChange query from the
newsgroup post. However, your newsreader must have put a carriage
return in there (i.e. word wrap), after the 'All' in 'Details All
Categories'. This has to all be on one line in your query.

SELECT TOP 1 ProductsTTL.ProductID
FROM ProductsTTL
WHERE (((ProductsTTL.CategoryID)=[Forms]![Details All
Categories]![CategoryID]))
ORDER BY ProductsTTL.LastEdited DESC;
 
G

Guest

Ok that opens the last record in whatever category I manually open. On open
the main form is in the first category. Focus is in the cboCategory...if I
click the last edited it errors... then I need to manually change categories
but that is the point I don't know what category the record was in that I was
last working on. If you notice my original post said:
I am trying to have my form open with the last edited record (which is a
subform). The subform info is accessed by a combobox in the footer. ...
I just want the form to open in the category where I was last working. The
category is chosen by the combobox it doesn't actually have to open in the
exact record just in the last category... either way. Is this possible?

The concept is .... 2000 products... 50 categories. I could be making
changes in Cat 48 but I don't remember... I want to be able to get back to
the last record I was working on in whatever CATEGORY... so I can continue
where I left off. I thought a command button to last edited could accomplish
that. But, it isn't doing that.

Maybe it isn't possible... the original

Screen.PreviousControl.SetFocus
DoCmd.OpenForm "Products List", , ,
"[LastEdited]=DMax('[LastEdited]','ProductsTTL')"

at least took me back to the category and record. I just wanted it to do the
same thing but stay WITHIN the supform instead of opening in a new window.

Thanks!
 
G

Guest

http://allenbrowne.com/ser-18.html
Try this for an answer!!
--
Remember: There are suppose to be no "dumb" questions!


lmv said:
Ok that opens the last record in whatever category I manually open. On open
the main form is in the first category. Focus is in the cboCategory...if I
click the last edited it errors... then I need to manually change categories
but that is the point I don't know what category the record was in that I was
last working on. If you notice my original post said:
I am trying to have my form open with the last edited record (which is a
subform). The subform info is accessed by a combobox in the footer. ...
I just want the form to open in the category where I was last working. The
category is chosen by the combobox it doesn't actually have to open in the
exact record just in the last category... either way. Is this possible?

The concept is .... 2000 products... 50 categories. I could be making
changes in Cat 48 but I don't remember... I want to be able to get back to
the last record I was working on in whatever CATEGORY... so I can continue
where I left off. I thought a command button to last edited could accomplish
that. But, it isn't doing that.

Maybe it isn't possible... the original

Screen.PreviousControl.SetFocus
DoCmd.OpenForm "Products List", , ,
"[LastEdited]=DMax('[LastEdited]','ProductsTTL')"

at least took me back to the category and record. I just wanted it to do the
same thing but stay WITHIN the supform instead of opening in a new window.

Thanks!
 
S

Steve Schapel

Lmv,

I am familiar with this article and this approach. It is very good.
However, I can't see how this pertains to your original question, which
was about an entirely different problem than Allen's article addresses,
and is much more simply solved than Allen's article describes.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top