This code is a snippet of the code im using. The problem is and i know why is if i put tony(txt1) in it will pull up everything tony, if i put tony(txt1) rose(txt2) in it will put everything with tony(txt1) and rose(txt2) intead of strictly only the tony roses. If i put like Tony(txt1) FL(txt3) it will pull up everything in florida and everything tony. these are all different text boxes as you see below. Now i want if i put Tony(txt1) FL(txt3) it will only pull up the tonys in florida not everybody named tony and everybody in florida. Is there an easier method of doing this then.. well i actually am not sure on where to start. some suggestions please? Thanks!
Thanks for the help!
Running in circles is what I do best!
Code:
Do Until countx = dbMain.Recordset.RecordCount 'loop all the database data and search the string
If LCase(dbMain.Recordset.Fields("CompanyName")) Like LCase(txtBName) Or _
LCase(dbMain.Recordset.Fields("FirstName")) Like LCase(txtFName) Or _
LCase(dbMain.Recordset.Fields("LastName")) Like LCase(txtLName) Or _
LCase(dbMain.Recordset.Fields("MiddleName")) Like LCase(txtMInitial) Or _
LCase(dbMain.Recordset.Fields("StreetAddress")) Like LCase(txtStreet) Or _
LCase(dbMain.Recordset.Fields("City")) Like LCase(txtCity) Or _
LCase(dbMain.Recordset.Fields("StateOrProvince")) Like LCase(txtState) Or _
LCase(dbMain.Recordset.Fields("PostalCode")) Like LCase(txtZip) Or _
LCase(dbMain.Recordset.Fields("HomePhone")) Like LCase(txtHomeNum) Or _
LCase(dbMain.Recordset.Fields("WorkPhone")) Like LCase(txtWorkNum) Or _
LCase(dbMain.Recordset.Fields("MobilePhone")) Like LCase(txtCellNum) Or _
LCase(dbMain.Recordset.Fields("EmailAddress")) Like LCase(txtEmail) Or _
LCase(dbMain.Recordset.Fields("Birthdate")) Like LCase(txtBdate) Or _
LCase(dbMain.Recordset.Fields("CustomerID")) Like LCase(txtSAccount) Then
'if the recordset is same
Thanks for the help!
Running in circles is what I do best!