how is this example work, textbox search

woody

Registered User.
Local time
Today, 09:22
Joined
Jan 26, 2011
Messages
23
hello ,
please anyone can see this example and explain for us how its work,
if i want make another one with different form and table name,

Thanks ,
 

Attachments

If you can attach a copy in 2003 format I'll have a look when I get back from lunch.
 
Not sure if this is the same solution as above since that is an accdb file, but here's a possible solution using the filter property.
 

Attachments

I just complete my simple program.. but i have problem in forms
Contacts list
Follow-up
in QuickSearch . please anyone can fix that..i need it really fixed,

Thanks a lot.
 

Attachments

I'll have a look now.

I use 2003 because that's what the business uses. Given that we have over 700 computers in this building alone it's a significant cost to update them all and updating just mine would be pointless as I would have to save it as a 2003 file anyway for the end users.

Besides, I'm just a database developer, I don't control the financial budget. :)
 
Thank u dear, i hope u can help me to fix that QuickSearch .

Thanks
 
The same code provided in the example should work here.

What field should the search textbox search on?
 
In Customers list its working fine.

You can see the Macro , in Follow-up form

SetTempVar strFilter, "([Place of Installation] Like ""*" & [TempVars]![strSearch] & "*"")"
SetTempVar strFilter, [TempVars]![strFilter] & " OR ([Customer Name] Like ""*" & [TempVars]![strSearch] & "*"")"
SetTempVar strFilter, [TempVars]![strFilter] & " OR ([Company Name] Like ""*" & [TempVars]![strSearch] & "*"")"
SetTempVar strFilter, [TempVars]![strFilter] & " OR ([Phone Number] Like ""*" & [TempVars]![strSearch] & "*"")"
 
Right, I've done it on the follow up form. I removed the filter property in the form properties window so that it starts without a filter. Other than that it's just the VBA behind the search & show all record buttons.

However, I want you to look at the code and update the contacts form yourself. I've shown you how it works now you need to start doing it for yourself so you remember it. :)
 

Attachments

Hi , u mean u add this code
Dim strFilter As String

If Not IsNull(SearchBox) Then
Me.FilterOn = True
strFilter = "[Place of Installation] Like ""*" & SearchBox & "*"" "
strFilter = strFilter & " OR [Customer Name] Like ""*" & SearchBox & "*"" "
strFilter = strFilter & " OR [Company Name] Like ""*" & SearchBox & "*"" "
strFilter = strFilter & " OR [Phone Number] Like ""*" & SearchBox & "*"" "
Me.Filter = strFilter
cmdShowAll.Enabled = True
End If
 
and this in showall button


Me.Filter = ""
Me.FilterOn = False
cmdShowAll.Enabled = False
 
But.. there is still problem.. if you open Follow-up , or Contacts list alone,,
and try to make Search its asking about Customers List form...
 
That and:
Code:
Private Sub cmdShowAll_Click()
Me.Filter = ""
Me.FilterOn = False
cmdShowAll.Enabled = False
End Sub

This piece of code cancels the filter and disables the show all records button again.

Note that the filter code (which you just quoted) checks to ensure the field isn't null but does not have an Else to explain what to do if the button is clicked and it is null. Not sure how you want to handle that, I'd likely use a MsgBox to tell the user to input something to search for.
 
Works fine for me when I open the follow up form without anything else open (other than the fact that you have images embedded which I do not have).
 
Hi Again... i do it... but there is small problem...
when i insert text in text box to search i need to double-click on Search button.


why.?
 

Users who are viewing this thread

Back
Top Bottom