Hi Guys,
What do i need to add from below codes in order to prompt "Record not found" in case of no match on the database? I feel its an IF then Else statement but dont know how to apply
-------------------------------------------------------------------------------------------------------------------------------------
Private Sub btnCompoSearch_Click()
Dim SQL As String
SQL = " SELECT T_Parts.Component, T_Parts.[Machine1], T_Parts.[Machine2], T_Parts.[Machine3] FROM T_Parts WHERE [T_Parts.Component] = '" & Me.txtCompoKeyword & "' "
Me.SubComponentSearch.Form.RecordSource = SQL
Me.SubComponentSearch.Requery
End Sub
What do i need to add from below codes in order to prompt "Record not found" in case of no match on the database? I feel its an IF then Else statement but dont know how to apply
-------------------------------------------------------------------------------------------------------------------------------------
Private Sub btnCompoSearch_Click()
Dim SQL As String
SQL = " SELECT T_Parts.Component, T_Parts.[Machine1], T_Parts.[Machine2], T_Parts.[Machine3] FROM T_Parts WHERE [T_Parts.Component] = '" & Me.txtCompoKeyword & "' "
Me.SubComponentSearch.Form.RecordSource = SQL
Me.SubComponentSearch.Requery
End Sub