Not sure how to create a dialog form. I have stuck this code on to a button on the form I want the search string to go to. The field I want to search is [Spin]. But its still not working. The box comes up when the button is clicked and when I enter the anything in the box it comes up with "Invalid use of Null". The main form is called Prisoner_Details.
Private Sub cmdFind_Click()
On Error GoTo Err_cmdFind_Click
Dim answer As String
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Prisoner_Details"
answer = InputBox("Enter the Spin Number you wish to search for", "Find on Spin")
stLinkCriteria = "[Spin]= answer
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdFind_Click:
Exit Sub
Err_cmdFind_Click:
MsgBox Err.Description
Resume Exit_cmdFind_Click
End Sub