Hello everyone
I posted a similar question a while back in the forms section (https://www.accessforums.net/forms/m...rch-11840.html).
I got a nice reply but still need a bit more assistance. Basically i want a text box that updates what record is shown on the form by user input.
Here is an example:
customer A: aaabcd
Customer B: aaddc
User types: "aa"
it will show whichever record is first
User types: "aaab"
It will show customer A.
A good example of this is the default search that access has on the bottom of each form (i basically want to move this onto the actual form).
This is what i have so far, this code is placed behind the button:
The form is called "Workorders by Customer"Code:Private Sub Searchbutton_Click() SQL = "select * from Workorders by Customers " & _ "where Companyname LIKE '*' & '" & Me.Searchtext & "' & '*'" Me.Workorders by Customer.Customers = SQL Me.Workorders by Customer.Requery End Sub
Textbox is called "Searchtext"
Button is called "Searchbutton"
Table is called "Customers"
Field i want to search is "Companyname"
Thanks a lot
Edit: Btw, this code gives me an error "Compile error: Variable not defined" and it highlights line 2 ("SQL =")