I've got a text box (txtSearch) and I've got a command button (cmdSearch).
The cmdSearch has this onclick event:
Expand|Select|Wrap|Line Numbers
- <SCRIPT language=vbscript event=onclick for=cmdSearch>
- <!--
- Dim rs
- Set rs = MSODSC.DataPages(0).Recordset.Clone
- On error resume next
- rs.find "[WO NUMBER]=" & (txtSearch.value)
- If (err.number <> 0) Then
- Msgbox "Error: " & err.number & " " & err.description,,"Invalid Search"
- Exit Sub
- End If
- cmdWOSearch.focus
- If (rs.bof) or (rs.eof) Then
- Msgbox "Error Work Order not found.",,"Search Done"
- Exit Sub
- End If
- MSODSC.DataPages(0).Recordset.Bookmark = rs.Bookmark
- cmdWOSearch.focus
- -->
- </SCRIPT>
Really this is three questions.
How to catch the enter key when it is pressed in the txtSearch box.
How to call an event from another event.
Are data access pages good to use?