Search box and search button in form - scholarship database

  • Thread starter Thread starter alpha
  • Start date Start date
A

alpha

Guest
I'm having trouble implementing a search function in a form. I've looked at code on this site, but I'm a novice at vba.

Can anyone suggest how to make the search button work correctly? The database is attached.

Some additional info:

- I'm a volunteer helping out my favorite non-profit organization.

- Much of the data in the "Customers 03-04" table will be imported from the organization's accounting system. Because of this, full normalization isn't a goal.
 

Attachments

Last edited:
I have added a search form to your database.
There is no error checking, so you will have to add this yourself.

I hope it's useful.
 

Attachments

Rather than creating a SQL statement dynamically, Use a Query to as the form's recordsource and in the [Customer ID] field use the criteria

Like Forms![Customers 03-04]!Searchbox or Forms![Customers 03-04]!Searchbox isNull

this will allow you to filter for the full criteria or return all records if the search box is empty.

For a partial match use Like "*" & Forms![Customers 03-04]!Searchbox & "*" or Forms![Customers 03-04]!Searchbox isNull

hth
 
Thank you. I'm on the road using someone else's old Win98 machine, so I am unable to see your attachments yet.


SStreet:

Uhhh, error checking?

Fizzio:

I assume you're making suggestions to enhance SStreet's file. I'll try to incorporate your ideas in the file when I get back to my PC.

Thanks again.
 
I thought I would reply in this post instead of creating a new one since it is the same topic...
Would it be possible, to create a search form and have the user enter in expressions such as ">" or "<" into the fields they wish to search for? Or is a separate field for expressions the only way to go?
Thanks!
 
db2me:

Create a new thread. It's bad manners to hijack someone's thread. Post a link in yours to this one if necessary.
 
No alpha, the suggestions were for your original Db but could equally apply to the Db that sstreet posted.
 
Error checking i.e. when you do a search that comes up with no records, a message box pops up with "No records found".
 
Thanks, the search form works great!

If only I could figure out how to create something like this myself...
 
No problem!

I learn't Access from other peoples databases and code. The best way to learn is to write your own code for everything that access does, even if it will normally create the code for you.
 
sstreet,

you stole my avatar;)
 

Users who are viewing this thread

Back
Top Bottom