Opening a record

R

Rush

I have an access form where i enter an id number, then
click on a button to take me to a second form. I would
like for the information corresponding to this id number
to pop up in the second form automatically when the second
form comes up. problem is, when i click on the button and
the id number is not already in the database, then the
information for the first record in the database comes up.
in this case, i would like for the new id number to be
there with a blank form. How would I accomplish this?
Thanks in advance
 
V

Van T. Dinh

Try using DCount() to see if the ID entered exists in the
Table or not. If it does, open the second Form at this
Record. If it does, open the second Form at new Record.

HTH
Van T. Dinh
MVP (Access)
 
Top