ili_sophia
Registered User.
- Local time
- Today, 20:58
- Joined
- Aug 23, 2017
- Messages
- 40
Hi there, i have this code in my search command button where it searched based on two field MXD and Batch no. However, i get the error of data type mismatch in criteria expression
does anyone know why
does anyone know why
Code:
Sub Search()
Dim StrCriteria, task As String
Me.Refresh
If IsNull(Me.PO) Or IsNull(Me.BatchNumber) Then
MsgBox "Please enter the MXD and Batch Number"
Me.MXD.SetFocus
Else
StrCriteria = "[P/O]='" & Me.PO & "' AND [BATCH NO] =" & Me.BatchNumber
task = "Select * from [Setting Machine Production] subform where " & StrCriteria
' DoCmd.ApplyFilter task 'won't work using this method
'order by [P/O]
Me.SettingMPsubform.Form.RecordSource = task
End If
End Sub
Last edited: