473,385 Members | 1,901 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Need help with creating a customized search form

Hello,

I'm currently in the process of creating a small access database and I'm having some problems with creating a customized search. I would like the user to be able to search a record by last name or street address. I have two questions:

1. I am currently using the built in "find and replace" dialog box, which works fine for the most part, but I need to be able to add some code to make the search more customized. I'm new to access, so my VBA skills are still limited. I have been unable to find code examples that are similar to the "find and replace" dialog box. Does anyone have code examples that might be similar?

2. I also tried adding two combo box search options on my form (one for last name and one for street address). The last name search works fine, but to do a search by street address, I must enter the street number first, or I get an error. I would like to be able to enter the street name (or better yet, part of the street name) first. Here is the code that I;m currently using:

Me.RecordsetClone.FindFirst "[ID] = " & Me![Addressdropdown]
Me.Bookmark = Me.RecordsetClone.Bookmark

Any help or code examples would be appreciated.

teephish
Feb 15 '08 #1
3 2480
hey there
you can find an excellent tutorial/example provided by allen browne here
how to build a search form which can handle multiple criteria
Feb 16 '08 #2
Jim Doherty
897 Expert 512MB
Welcome to the scripts! and fun honing your VBA skills.

Have a look at this example db I knocked up for newbies to give an idea on one technique that provides for multi field searching in combination with a wildcard thrown in if needed. It is fairly complex to look at particularly if you are new but as you develop your skills and if you are persistent and break each code segment down and follow it through you will see one or two other helpful things.

Included is the ability to output the resultset to excel and also output a listboxs rowsource using an intermediary dialog box, set a reports recordsource on the fly based on the search return, open a form to a particular form record from an existing form record, display a custom please wait message centrally on screen, use conditional formatting based on a row value

Regards

Jim :)

Footnote: Whilst the attachment works completely fine in Access versions prior to 2007 Having since tested the attachment out on Access 2007 I note that subform recordsources when set on the fly fail to set properly and only returns the first record as opposed to the expected continuous list.
Attached Files
File Type: zip searchdemo.zip (194.9 KB, 379 views)
Feb 16 '08 #3
hey Jim, lotta stuff going on there, thank you for sharing! :)
Apr 22 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: MSM | last post by:
Hello, This may be posted twice if so i apologize. I am creating a form using php where the information entered into the form will go into a database. When creating the tables in SQL where do I...
2
by: Derek Jones | last post by:
I am currently working on an application for our Business Office to easily search for new budget codes that we have to establish due to an administrative system conversion we are currently...
16
by: Joel Finkel | last post by:
Folks, I am confused as to how to implement the following solution. I have a series of processing steps, each of which contains similar features (forms, etc). Therefore, I create a base...
20
by: Jason Dravet | last post by:
Some time ago I wrote an application that controls the projectors in our classrooms(turn on, turn off, and volume control). This application is written in VB.net 2003. It was working perfectly...
3
by: hazly | last post by:
I'm very new in the web technology and need advice on search engine. I want to develop a portal using PHP and MySQL on Linux. Need to know on the following features : 1. search engine that could...
3
by: cuties | last post by:
Hi all.... i'm very new to this programming language. i'm required to fulfill this task in the company i'm doing my practical. i hope i can get guide for my problem... Here is the script i...
9
by: pic078 via AccessMonster.com | last post by:
I need serious help - I have a frontend/backend Access database (2 MDE Files) that remains stuck in task manager after exiting the application - you can't reopen database after exiting as a result...
2
by: sorobor | last post by:
dear sir .. i am using cakephp freamwork ..By the way i m begener in php and javascript .. My probs r bellow I made a javascript calender ..there is a close button ..when i press close button...
1
by: David De | last post by:
Need help with my site - search function within my site not working?!? I purchased this template, customized it and found out it has a search function for within the site - the challenge is that...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.