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

Creating a Form to find a Record using Multiple Criteria

Hi there,

I'm still relatively new to Access and am trying to build a database to track applicants for jobs.

The form I'm having a problem with is one for "Editing applications". I want to use this form to look up an application and then use a subform to add on information about interviews.

I think I actually have two problems:

1.) I want to search for a single record using two criteria and I'm not sure how

2.) When I'm trying to search for a record using the foreign key in a combobox, the foreign key is listed several times, once for each time it's in a record of the table.


I have an autonumber ApplicationID as my primary key for the Application table, but would like to select a Candidate using their Name, instead of by the CandidateID (which is the foreign key of the Application Table).The problem is that because some candidates apply to more than one Position, the combobox shows their name for as many applications as they already have.

For example, if Homer Simpson, Marge Simpson, Bart Simpson and Lisa Simpson all applied to a "Cartoonist" position, but Lisa also applied to a "Lawyer" position, when I try to search by the candidate name (or even Candidate ID), it will look like this:

Bart Simpson
Homer Simpson
Lisa Simpson
Lisa Simpson
Marge Simpson


I don't want Lisa to show up twice just because she has two applications. If I were looking for the record in the Application table where Lisa wants to be a Cartoonist, I wouldn't be able to know which one it would be. Likewise, if I were to start with the other combobox and search by position, then I would see 4 entries of "Cartoonist" and one for "Lawyer" with no way of figuring out which one is the actual record that I want.

I want the form to allow me to choose from a list of Positions that are vacant, and then after that, select the Candidate and then view the Application information specific to those two criteria.

I know this is a really complicated question that involves a lot of work, but if anyone can even point me towards another place I can find the answer, please let me know.

I've been trying to figure this out for about a week now. =(. Any help would be GREATLY appreciated!
Jun 5 '10 #1
1 6956
mseo
181 100+
hi,mbbum88
I don't want Lisa to show up twice just because she has two applications.
you shouldn't use bound controls in search form
you should use unbound combobox and get the candidate name by query to be listed in the combobox and the same for your second criteria control
then put your search cmbbutton on the form and use the following code behind it:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Search_Click()
  2.     Const cInvalidDateError As String = "You have entered an invalid data."
  3.     Dim strWhere As String
  4.     Dim strError As String
  5.     strWhere = "1=1"
  6.     ' If canditate name
  7.     If Not IsNull(Me.candidatename) Then
  8.     'Create Predicate
  9.         strWhere = strWhere & " AND " & "applications table name.[candidateID] = " & Me.yourcandidate control& ""
  10.     End If
  11.   Else
  12.     If strError <> "" Then
  13.         MsgBox strError
  14.         End If
  15.         Me.your subform name.Form.Filter = strWhere
  16.         Me.your subform name.Form.FilterOn = True
  17. End Sub
  18.  
Welcome to BYTES
Jun 5 '10 #2

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

Similar topics

2
by: phpuser32423 | last post by:
Hi everyone Is it by any chance possible to use mysql and php to auto create the content for drop-down lists on forms by retrieving the values from a database? The reason i ask is that on a site...
5
by: ddecoste | last post by:
I am trying to create a form to make it easier to modify a record without having to page through all the records. I have started the form with 3 cascading combo boxes. ie #1 asks for division ,...
1
by: Apple | last post by:
May any one can teach me the easy way to create a combo box in a form to find record.
4
by: kufre | last post by:
How can I use three criteria to find a record? I've done this before where I only use one criteria to find a record and set the focus to that criteria only. Thanks in advance.
1
by: Nathan Sokalski | last post by:
I have a Visual Studio Solution that contains multiple ASP.NET Projects. I do not want to put all of the pages (*.aspx files) in the root directory of my site, because that would be very...
16
by: tiarynn | last post by:
Hi everyone, I am a beginning to intermediate user with Access 2000 on XP. I am trying to create a query from a table of more than 1300 records. I need to look up individuals by their SSN only...
1
by: akirekab | last post by:
I am using DCount, but I am not able to find how to set simple multiple criteria. Here is sample of what i need. =DCount("PatientProfileID","qryFaceToFaceReason_EAP_VG","FaceToFaceReasonID=2"...
2
by: dlevene | last post by:
Hi - newbie here, be gentle. In Access 2003, I've created a report (based on a query) to produce mailing labels for all records where = "Community". is a combo-box field with the values coming from...
3
by: kstevens | last post by:
Please help. I know the sysntax is wrong. Here are some details. I am looking for the sum of past shipped items. I originally wrote this Dsum with only one criteria, but because of multiple...
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: 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: 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
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
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,...

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.