You have to store the value somewhere that you can remember what it was so
that you can pass it to the form you are opening or let the form retrieve
the value once it opens.
Options:
1) Hide the form you're closing instead of closing it. Once you're done
passing the value, then close it.
2) Get the value and store it in a variable that has sufficient scope that
the variable's value can be retrieved by the new form.
3) Get the value and pass it in the OpenForm command in the Where argument
or as a OpenArgs argument.
4) Have a Property in your database that will hold this for you and retrieve
it from there.
5) Store the value in the registry then retrieve it.
6) Store the value in a field in a table in such a way that you will know
what the last entry was (i.e. possible store a date and time in another
field of the same record). This could be problematic if other users are also
using the database and could add another record between the time you add
yours and open the new form.
7) Save the value to a temporary file and retrieve it from there. Of course
you would have to also remember the name of the temporary file, so you might
as well just remember the value instead.
While options 4-7 can work, I recommend 1-3. Option 1 is probably the
easiest.
--
Wayne Morgan
MS Access MVP
"
[email protected]"