Hello everyone,
I've got a main form with a search field and a subform. what I would like to do,
is when I hit the "search" button, the data on the subform will be changed
according to the search filter, I've got no problems with the sql expression.
my problem is: How can I change the recordsource of the subform from
the main form?
My code:
subform:
Private Sub Form_Open(Cancel As Integer)
Me.RecordSource = "select * from Transaction order by details"
End Sub
---------------------------------------------------------------------------
Main form:
Private Sub cmdSearch_Click()
Forms!subTrans.recordsource = "select * from transaction where Name like " & """" & "*" & txtSearch & "*" & """" <--- error massage
subTrans.Requery
End Sub
I've got a main form with a search field and a subform. what I would like to do,
is when I hit the "search" button, the data on the subform will be changed
according to the search filter, I've got no problems with the sql expression.
my problem is: How can I change the recordsource of the subform from
the main form?
My code:
subform:
Private Sub Form_Open(Cancel As Integer)
Me.RecordSource = "select * from Transaction order by details"
End Sub
---------------------------------------------------------------------------
Main form:
Private Sub cmdSearch_Click()
Forms!subTrans.recordsource = "select * from transaction where Name like " & """" & "*" & txtSearch & "*" & """" <--- error massage
subTrans.Requery
End Sub