code for SEARCH button

Cindy

Registered User.
Local time
Today, 10:42
Joined
Jul 3, 2014
Messages
160
Hi, could someone help me with the code to fix this SEARCH button please?:confused: When I type in the searchbox, the subform pulls up the data already. The button gives an error when clicked. I would get rid of the button but the searchbox looks better with it. Any help is appreciated.
 

Attachments

  • searchBUTTONerror.jpg
    searchBUTTONerror.jpg
    43.3 KB · Views: 142
  • test_Database.accdb
    test_Database.accdb
    1.2 MB · Views: 186
Cindy, I already explained why it's not working in its present form in your last post. If you want to *make* it work did you try my suggestion of moving it to the Subform?
 
sorry didn't mean to be a nag. I'd checked yesterday's thread before starting this one and there wasn't an update at the time. Thanks again.

and you as well vbaInet!!
 
No problem, got a little tied up and I didn't have a chance before.
 
Hey Gina, one more thing. In the On Click Event of the SEARCH button, it automatically takes me to an empty VB subroutine. At the beginning, when I clicked on the ellipses (...) it would show an option of macro or procedure. Now it goes straight to procedure. How can I switch the window from VB to macros?
 
That's new, it went straight to the Macro for me, did you change something?
 
Under File > Options > Object Designers uncheck *Always use Event Procedures*, close and reopen and it should be back to normal.
 
it still took me strainght to :

Private Sub cmdSEARCH_Click()

End Sub
 
Delete those lines or it will always think you want to put something there.
 
I did many times but whenever go back and I click on the ellipse (...). It recreates the lines:banghead:
 
I clicked on the GOT FOCUS event and had a pop-up. It asked what I wanted: Macro, code builder, etc. That is what I need for the "ON CLICK" event but it doesn't pop up:o
 
I selected "macro builder" for the double click event and went back to the On-Click event and the pop up came back. I'll apply the Filter. Hope it works. Many thanks Gina:)
 
Oh, I see you finally got it, let's hope it really does work! :D
 
as you guessed, it didn't work! after typing the search text and clicking on the SEARCH button a dialogue box popped up showing:
[MacroError].[Description]:confused:

However when I finished typing in the searchbox and clicked the button, the find/replace box popped up. That is not what I want:banghead:

I want it to search the table based on the searchbox text.
 
Thanks Gina. That's a lot of code to grasp at once and my head hurts:confused: I'll move on to something else for now:)
 
When you're ready we're to help! :D Side note: While it looks like a lot it's really not that bad.
 

Users who are viewing this thread

Back
Top Bottom