473,387 Members | 1,388 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,387 software developers and data experts.

How to add a search field in Access 2007

Hi,

Wonder if someone can help me?

I have two tables, one is a project table and one is an address table, in addition I have a project form bound to the project table.

I've created a lookup field (at table level) to allow the ability to lookup and select multiple addresses that are related to the project but there are 100,000s of properties so i need a way of searching and then selecting the relative properties from the project form.

E.G.

Project Table
ID - Autonumber (primary key)
Associated Properties - Text

Address Table
ID - Text (primary key)
Address - Text
Zip Code - Text


project form

Associated Properties (Search for properties to link to the project by zip code or address) select the properties related and add to the project.

I tried by just creating a query and putting [Enter Zip Code] as the criteria and that kind of works but it always pops up the box every time i load the form.

Any help is much appreciated

Many thanks

superblade
Aug 18 '15 #1
1 1136
jforbes
1,107 Expert 1GB
Usually, what I do in a situation like this is to create and use a Pop-up Form (Dialog) to Filter and Select the Value.

The basic idea:
  1. First, create a Global Variable to hold the Value that you are looking for.
  2. Create the Dialog Form that allows the user to perform some Filtering on it's contents to narrow down the list from all the possible items. Sometimes a Continous Form works well in this situation, but I find Continuous Forms a pain to maintain. So, I usually go with a Single Form and either use a ListBox if there isn't much information to display about the Value to search for, or a Datasheet SubForm when there is a lot of columns of information to sift through. Regardless of the way to list the Rows, they are Filtered similarly.
  3. Build into the Form the Filtering by placing TextBoxes and ComboBoxes to gather the Filter criteria from the user. Then either with a CommandButton or on the TextBoxes/ComboBoxes AfterUpdate Events, Filter the list of Values. This might explain this step further: http://bytes.com/topic/access/insigh...filtering-form
  4. Add a Button to copy the selected Value into the Global Variable setup in the first step and then call DoCmd.Close to Grab the selected Value and close the Form.
  5. Then put it all together by adding a button to call the Lookup/Dialog on the Main Form that clears out the Global Variable, calls DoCmd.OpenForm on the New Lookup Form with the Window Mode to acDialog so that when ran, the Code will stop and wait for the Dialog to be Closed. Then the last thing to do in the Button is see if the Global Variable has a value; if it does, set the local Field equal to the Global Variable. If the Global Variable is still cleared out, then the user canceled out of the Dialog Form and nothing should be done.
Aug 18 '15 #2

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

Similar topics

5
by: Ira Solomon | last post by:
Hi: Any quick opinions on Access 2007? Has anyone got this to coexist with Access 2003? Thanks Ira
49
by: Allen Browne | last post by:
If you are looking for opinon on what's useful in Access 2007, there's a new article at: http://allenbrowne.com/Access2007.html Covers what's good (useful features), what's mixed (good and bad),...
4
by: Balex | last post by:
Hi I have recently helped somebody converting an Access application into an Access (2002) front-end and an Oracle backend. It worked fine, until he decided to install and use Access 2007...
2
nico5038
by: nico5038 | last post by:
Access 2007 Linkedtable manager refuses to relink tables having a field with the "Attachment" datatype. Problem: When placing a split database in another folder, the Linked table manager should...
9
by: prakashwadhwani | last post by:
Hi !! I'm about to develop a new project for a client. Should I go about it in Access 2003 or 2007 ? Purchasing it either for me or for my client is not a major consideration here ... what I'd...
10
by: kujito | last post by:
Ok, here it goes. I got my queries straightened out and they return the data I want in the format I want(finally). The data are sorted alpha. descending by ProjectName. Each project has a unique...
6
TheSmileyCoder
by: TheSmileyCoder | last post by:
I need to create a table, where one of the memo fields shall be a Rich Text field. Can anyone help me with that? This is the code I currently have. Public Sub createConTable() 'Create the table...
9
by: walid geagea | last post by:
Hello, I have written the following codes in order to open a word document from an Access 2007 form. The document was openned correctively but the problem is that I want to be able to go to a...
2
by: Pat Bolen | last post by:
I am attempting to write code or query to find any numeric value in a text field. The records will have both numeric and alpha characters but I want to comb through the records and make a list of the...
1
by: cristosjulian | last post by:
Hi Access 2007 memo field corruption I am currently supporting a Access database. The database has a Access 2007 Front end which in saved on the desk top for multiple users and the backend...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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.