Open a record based on a value

D

Dan Cole

I have an order form where in the upper left is a field
called OrderID. This is an autonumber field that is also
the primary key in that particular table. It is also the
number by which we refer to our orders. How can I set it
up so that a user can type in a number here and have it go
to that particular order? Or similarly, put something on
the main switchboard that says "Go to order #" followed by
a text box where the user enters the appropriate order
number to open in the Orders form. Thanks!
 
P

Pavel Romashkin

Put this code in the OrderID field's AfterUpdate event:

Me.Form.Recordset.FindFirst "OrderID = " & Me.OrderID

I would make OrderID unbound to avoid confusion that can arise from
mistakingly replacing OrderID.
But I would not at all like to use a design like this because I would
need to type in - menaing, remember or manually find first - an OrderID
number. In my opinion, it is the database's job to help the user do this.
Pavel
 

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