sambucaman
Registered User.
- Local time
- Today, 02:47
- Joined
- May 6, 2010
- Messages
- 41
Hi guys
I have a form, with the following code on
This works very well for searching through my customers, and returns results within the same form. However, I have a subform on the form, called "OrderHistory" which is just a simple table with orderdate, ordernumber, orderamount, ect.
Is there anyway to modify the above code to search the table "OrderHistory" for the field "OrderNumber" and display the results in the same way as above?
I have tried to jiggle the above, but to no avail...
Thanks in advance!
I have a form, with the following code on
Code:
Private Sub searchName_AfterUpdate()
Dim LSQL As String
Dim LSearchString As String
If Len(searchName) = 0 Or IsNull(searchName) = True Then
MsgBox "You must enter a search string!"
Else
LSearchString = searchName
'Filter results based on search string
LSQL = "select * from Customers"
LSQL = LSQL & " where Name LIKE '*" & LSearchString & "*'"
Form_Customers.RecordSource = LSQL
'Clear search string
searchName = ""
'MsgBox "Results. All customers containing " & LSearchString & "."
End If
End Sub
Private Sub searchName_BeforeUpdate(Cancel As Integer)
End Sub
This works very well for searching through my customers, and returns results within the same form. However, I have a subform on the form, called "OrderHistory" which is just a simple table with orderdate, ordernumber, orderamount, ect.
Is there anyway to modify the above code to search the table "OrderHistory" for the field "OrderNumber" and display the results in the same way as above?
I have tried to jiggle the above, but to no avail...
Thanks in advance!