Data Access Page

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

drdrew1469

Thread Starter
Joined
Nov 30, 2000
Messages
436
Is there anyone who can tell me how to use a combo-box, drop-down, or any version thereof, to control the recordnavigation or override it. My db has 150 records and I don't want click 30 times to get to the "G" names. The current combo-box only allows a single "controlsource" rather than "recordsource" like the recordnavigation control does. Any ideas?

Thanks,

Drew
 
Joined
Jun 26, 2000
Messages
7,762
I used Combo boxes to control navigation, and I have 2 of them. ! does a search by compnay name, and the other does it by Order #

In the properties of the Combo, you select Table/Query for the Row Source Type and in the Row source, you have SELECT [Customers].[CustomerID], [Customers].[CompanyName] FROM Customers ORDER BY [Customers].[CompanyName]; or somethign similar for your database, pointing to whichever table (Customers) and field on that table (Customer iD and CompnayName) you want to have displayed in the box. The ordered by means that the list displayed will be in alphabetical order.

Then, in the After Update filed of Properties, you insert [Event Procedure] and click on the ... box to the right of the text box, which will bring up your VB window. you need the proper coding which for my DB is:

Private Sub Combo30_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[CustomerID] = " & Str(Me![Combo30])
Me.Bookmark = rs.Bookmark
End Sub

and you need to make sure that the name of the combo box (Combo30 for me) matches the combo box you have.

For my OrderID search I have SELECT [Orders].[CustomerID], [Orders].[OrderID] FROM Orders ORDER BY [Orders].[OrderID]; in the Row Source

and

Private Sub Combo35_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[CustomerID] = " & Str(Me![Combo35])
Me.Bookmark = rs.Bookmark
End Sub


in VB


Hopefully this will give you an idea on how to search your own records!;)
 

Anne Troy

Anne
Joined
Feb 14, 1999
Messages
11,749
If you did a complete install, and you create a form, give the form a header. Drag a combo box into the header of the form and it'll come right out and ask you all the questions you need and do it for ya automatically.

If you didn't do a complete install, your wizards aren't installed and THEN you have to do it the real hard way, like Randy says.

If you want a rolodex-type thingee, download MyAddies at www.theofficeexperts.com/downloads.htm.

If the code's protected, I'll tell you the password in a PM.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Members online

Top