Me.[I][COLOR=red]MyFormName[/COLOR][/I].RecordSource = "SELECT * FROM [COLOR=red][I]MyTableName[/I][/COLOR] WHERE [[I][COLOR=red]MyTableDateField[/COLOR][/I]] " & _
"BETWEEN #" & Me.[COLOR=red][I]MyFormsStartDateTextBox[/I][/COLOR] & "# AND #" & _
Me.[COLOR=red][I]MyFormsEndDateTextBox[/I][/COLOR] & "#;"
This code work well if im only using this field in my form, but i have other field such as using listbox and combo box, it does nt fit in.
Can the "Me.[I][COLOR=red]MyFormName[/COLOR][/I].RecordSource" be change to others, rather then FormName. The reason is because i have a code which is
Private Sub btnSearch_Click()
' Update the record source
Me.frmsubRecords.Form.RecordSource = "SELECT * FROM qryrecords " & BuildFilter
' Requery the subform
Me.frmsubRecords.Requery