dropdown box in access2003 data access page

S

StuJol

im new to access pages so i apolise for the simple question but nomatter what
i seem to try, i just cant figure it out. for a training exercise im using
the northwind sample database in access 2003. i have saved the customers form
as a data access page.

i then went to design view and added a dropdown box in the header:customers
section. the wizard appeared but no option to "find a record on my form based
on combo box selection. How can i configure this dropdown box to select
records based on combo results?

any help would be much appreciated. in the mean time i shall continue to
search the internet for sample databases
 
D

Diane

You may have already received an answer to this problem but I wanted to share
mine with you. I had to do the exact same thing today where I had to create
a pop-up combo box and filter/select the records in my table from that combo
box. Below is my code and it works perfectly. My combo box is is based on a
query of the fields that are on my form which comes from the table. This is
the code that I placed in the "AfterUpdate" event of my combo box field on
the form. My SQL/Row Source statement is : SELECT DISTINCT [Active
Issues].[Item Type] FROM [Active Issues];. I set the pop up property to yes.

Private Sub Combo1_AfterUpdate()
' Find the records that match the combo box selection.
Dim rs As Object

Dim stDocName As String
Dim stLinkCriteria As String

Set rs = Me.Recordset.Clone
rs.FindFirst "[Item Type] = '" & Me![Combo1] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark

' Opens form to the filtered by selection records of the combo box.
DoCmd.OpenForm "Data form", _
WHERECONDITION:="[Item Type]='" & [Combo1] & "'"

End Sub
 

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