A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Open a record based on a value



 
 
Thread Tools Display Modes
  #1  
Old May 17th, 2004, 09:10 PM
Dan Cole
external usenet poster
 
Posts: n/a
Default Open a record based on a value

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!
  #2  
Old May 17th, 2004, 09:45 PM
Pavel Romashkin
external usenet poster
 
Posts: n/a
Default Open a record based on a value

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


Dan Cole wrote:

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!

  #3  
Old May 17th, 2004, 10:12 PM
Lynn Trapp
external usenet poster
 
Posts: n/a
Default Open a record based on a value

Create a ComboBox using the wizard and set it to lookup a value in the form.

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


"Dan Cole" wrote in message
...
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!



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:58 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.