I created a SearchForm with a SubForm (only) for the results. In the Form there are 6 argument that may be filled in for the actual search.
To actually start the search there is a button. On the Click of this button I would like a script is run.
Digging in several sites I came up with the following:
Table to look into: Organisaties, filled in as SearchForm's RecordSource at properties
Field to check: Plaats, Categorie and 4 more not included yet
Search argument names: Plaats_zoekkeuze, Cat_zoekkeuze
SubForm name: Zoekresultaat
Private Sub Zoekknop_Click()
Dim strWhere As String
strWhere = "1=1"
If Not IsNull(Me!Plaats_zoekkeuze) Then
strWhere = strWhere & " And [Plaats] = '" & Me!Plaats_zoekkeuze & "'"
End If
If Not IsNull(Me!Cat_zoekkeuze) Then
strWhere = strWhere & " And [Categorie] = '" & Me!Cat_zoekkeuze & "'"
End If
Me![Zoekresultaat].Form.RecordSource = strWhere
End Sub
Runtime error 3078; can't find input table or query!
At debug the first Me!-line is yellow and part after = seems to be the problem?
So as far as I can understand the actual found data can't be placed in the SubForm for whatever reason.
Can anyone help me complete this script succesfully?
Thanks for the effort
For anyone to have a closer look here is the zip for Access97:
To actually start the search there is a button. On the Click of this button I would like a script is run.
Digging in several sites I came up with the following:
Table to look into: Organisaties, filled in as SearchForm's RecordSource at properties
Field to check: Plaats, Categorie and 4 more not included yet
Search argument names: Plaats_zoekkeuze, Cat_zoekkeuze
SubForm name: Zoekresultaat
Private Sub Zoekknop_Click()
Dim strWhere As String
strWhere = "1=1"
If Not IsNull(Me!Plaats_zoekkeuze) Then
strWhere = strWhere & " And [Plaats] = '" & Me!Plaats_zoekkeuze & "'"
End If
If Not IsNull(Me!Cat_zoekkeuze) Then
strWhere = strWhere & " And [Categorie] = '" & Me!Cat_zoekkeuze & "'"
End If
Me![Zoekresultaat].Form.RecordSource = strWhere
End Sub
Runtime error 3078; can't find input table or query!
At debug the first Me!-line is yellow and part after = seems to be the problem?
So as far as I can understand the actual found data can't be placed in the SubForm for whatever reason.
Can anyone help me complete this script succesfully?
Thanks for the effort
For anyone to have a closer look here is the zip for Access97: