Hi Everyone,
I'm very new at coding, so I am hoping someone can help.
I want to create a command button that people can click on that will ask for an ID number which is also the primary key of the access database - I have picked up this script from microsoft, but now receive an error when I hit ok in the pop up window (error is Empty row cannot be inserted. Row must have at least one column value set.)
Script is as follows- can anyone please help me with this? (and explain it simply???) thanks 
<SCRIPT language=vbscript event=onclick for=Command1>
<!--
' Clone the recordset.
Dim rs
Set rs = MSODSC.DataPages(0).Recordset.Clone
Onerrorresumenext
' This line assumes that the value you are filtering on is an integer.
' If the search value is a string, use slightly different syntax.
' For example, "PMOProjectID = '" & CStr(InputBox("Please enter PMO ProjectID to find", "Find")) & "'"
' rs.find "PMOProjectID=" & cLng(inputbox("Enter a PMO ProjectID","Find"))
rs.find "PMOProjectID = '" & CStr(InputBox("Please enter project ID to find", "Find")) & "'"
' Custom error handling.
If (err.number <> 0) Then
Msgbox "Error: " & err.number & " " & err.description,,"Invalid Search"
ExitSub
EndIf
' Check search results for success.
If (rs.bof) or (rs.eof) Then
Msgbox "No Project found",,"Search Done"
ExitSub
EndIf
MSODSC.DataPages(0).Recordset.Bookmark = rs.Bookmark
-->
</SCRIPT>
|