Hi, i have a problem with a form, i don't know how to make a reference to a form property. The code is the following:
Private Sub cmdCautare_Click()
Dim strSQL As String, strOrder As String, strWhere As String
strSQL = "SELECT tblDosare.DosarID, tblDosare.DenumireDosar, tblDosare.CodDosar, tblDosare.DataDosar, tblInstante.Localitate, tblStadiu.Data, tblStadiu.Stadiu FROM tblInstante INNER JOIN (tblDosare INNER JOIN tblStadiu ON tblDosare.DosarID = tblStadiu.Dosar) ON tblInstante.InstantaID = tblDosare.Instanta"
strWhere = "WHERE"
strOrder = "ORDER BY DosarID"
If Not IsNull(Me.txtDenumire) Then
strWhere = strWhere & "(DenumireDosar) Like '*" & Me.txtDenumire & "*'"
End If
Forms!frmRezultateCautare.RowSource = strSQL & " " & strWhere & "" & strOrder
DoCmd.OpenForm "frmRezultateCautare", acNormal
End Sub
The problem is on this line:
Forms!frmRezultateCautare.RowSource = strSQL & " " & strWhere & "" & strOrder
The error message is the following: MS Access can't find the form 'frmRezultateCautare' referred to in a macro expression or Visual Basic code.
The form contains a list and is used to display the search results w.r. to the criteria from a main search form. If anyone can help i will apreciate it.
Thanks
Private Sub cmdCautare_Click()
Dim strSQL As String, strOrder As String, strWhere As String
strSQL = "SELECT tblDosare.DosarID, tblDosare.DenumireDosar, tblDosare.CodDosar, tblDosare.DataDosar, tblInstante.Localitate, tblStadiu.Data, tblStadiu.Stadiu FROM tblInstante INNER JOIN (tblDosare INNER JOIN tblStadiu ON tblDosare.DosarID = tblStadiu.Dosar) ON tblInstante.InstantaID = tblDosare.Instanta"
strWhere = "WHERE"
strOrder = "ORDER BY DosarID"
If Not IsNull(Me.txtDenumire) Then
strWhere = strWhere & "(DenumireDosar) Like '*" & Me.txtDenumire & "*'"
End If
Forms!frmRezultateCautare.RowSource = strSQL & " " & strWhere & "" & strOrder
DoCmd.OpenForm "frmRezultateCautare", acNormal
End Sub
The problem is on this line:
Forms!frmRezultateCautare.RowSource = strSQL & " " & strWhere & "" & strOrder
The error message is the following: MS Access can't find the form 'frmRezultateCautare' referred to in a macro expression or Visual Basic code.
The form contains a list and is used to display the search results w.r. to the criteria from a main search form. If anyone can help i will apreciate it.
Thanks