Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find a specific record in a Web form

Status
Not open for further replies.

hgpilot

MIS
May 6, 2003
4
US
I'm a newbie to Access so please bear with me. I have a 'web page' that shows all 16 fields from an Access 2000 database and would like to add a combobox(?) to search for a specific record based on the 'location' field. It was easy enough to do with a form using the wizzard but most users will not have Access on their PC's. I don't want them to have to scroll through the database (500 records) one record at a time to find what they're looking. Any help would be greatly appreciated.

Thanks... Steve
 
Hi Steve!
"web page" = ????made in Access (please say 'no')
are trying to use ASP?

> need more info?
:: don't click HERE ::
 
Hi Lebisol...

Thanks for the reply. I just got it working this morning. Yes I am doing it with a web page made by Access. The trick is to use a 'dropdown list box', select 'I will type in the values I want' (even though it will list them for you), select the field you want to search on, and finish. Then open the Microsoft Script Editor, go to the 'dropdown list box' you created, double click on the 'onchange'item and add the following VB script:

<SCRIPT language=vbscript event=onchange for=DropdownList0>
<!--
Dim rs
Set rs = MSODSC.DefaultRecordset
rs.Find &quot;[Location] = '&quot; & document.all.item(&quot;DropdownList0&quot;).value & &quot;'&quot;, 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>

I got most of it from the Microsoft Knowledge Base Article Q247823. But you have to be careful on how you set up the 'dropdown list box'. Hope this might help someone else in the future.

Thanks again... Steve
 
glad it worked out...
consider learning ASP when u get some time...u will never ever again relay on Access to do your web stuff :)
All the best!

> need more info?
:: don't click HERE ::
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top