Using Comnbo Fields as Lookup Fields for a Data Access Page

gmann

Registered User.
Local time
Today, 17:24
Joined
Jun 24, 2002
Messages
21
I need to use combo boxes to look up records based on the selecton for the combo box. I know u can't have it find records like in access forms. I found some code on microsofts website, but it doesn't seem to work.

<SCRIPT LANGUAGE=vbscript FOR=CustID EVENT=onchange>
<!--
Dim rs
Set rs = MSODSC.DefaultRecordset
rs.Find "[CustomerID] = '" & document.all.item("CustID").value & "'", 0, 1, 1

'0 = Skip zero records before starting the search.
'1 = Search in a forward direction.
'1 = Always begin the search with the first record in the recordset.
-->
</SCRIPT>

Any ideas?
Thanks
Greg
 
I'm kind of confused on what you're looking for.

Are you trying to go to a certain record that is indicated in a combo box?

Here's what i would do. Run a loop.

Do
If ("[CustomerID] = '" & document.all.item("CustID").value & "'" )Then
GoTo Exit
Else
DoCmd.GoToRecord,,acNext
End If
Loop

Exit:

This will loop until the record matches your criteria.

I hope that's what you wanted
 
Basically i want it to display the records based on what the user picks in the combo box. Its easy in a form, but i want to do it in a data access page. The code you wrote is in VB, u need vbscript for data access page.

Greg
 

Users who are viewing this thread

Back
Top Bottom