A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Search all table records from filtered form



 
 
Thread Tools Display Modes
  #1  
Old May 20th, 2010, 01:47 PM posted to microsoft.public.access.forms
BenEl via AccessMonster.com
external usenet poster
 
Posts: 18
Default Search all table records from filtered form

Hi. I'm hoping someone can help me with this search question...

MT_Position / PK = PositionID
MT_Candidate / PK = CandidateID
MT_Interview / PK = FirstName, LastName, Email / FK = PositionID, CandidateID

I have a tabbed form. On tab 1 is the main form (recordsource = MT_Position).
On tab 2 is a sub form (recordsource = QryCandidateInterview). The subform
displays all the Candidates who have applied to 1 Position. I would like to
include on this subform a searable list box with all the Candidates (not just
those related to the position). How can I do this? Any search I've been able
to put into the form, only searches the attached Candidates.

Thanks!

--
Message posted via http://www.accessmonster.com

  #2  
Old May 21st, 2010, 02:57 AM posted to microsoft.public.access.forms
Lord Kelvan
external usenet poster
 
Posts: 637
Default Search all table records from filtered form

Sorry to say that table structure seems well nuts it should be

MT_Position / PK = PositionID / fields = position fields ie
positionname,positiondescription, etc
MT_Candidate / PK = CandidateID / fields = FirstName, LastName,
Email
MT_Interview / PK & FK = PositionID, CandidateID / fields = (only
thing i can thinks might be useful here is an appointment type thing
such as interviewdatetime)

Ok first for the form i would have the recordsource as MT_Position
On the first tab have a hidden text box which has the controlsource of
positionid and name it something like txtpositionid
For the listbox on the second tab (NO SUBFORMS I think they are evil)
name it something like lstCandidates and with the properties of number
of columns as 4 and column widths as 0;2.5;2.5;4

In the forms onopen or onload event have this code
'=====code start======
lstCandidates.rowsource = "select MT_Candidate.CandidateID,
FirstName,LastName, Email from MT_Interview ,MT_Candidate where
MT_Candidate.CandidateID = MT_Interview.CandidateID and PositionID =
" & cint(txtpositionid.value)
lstCandidates.requery
'=====code end======'

My suggestion is based on the changes i have made to your table
structure as your table structure does not make sense unless the
candidate changes his/her name for every interview.

Hope this helps

Regards
Kelvan
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:55 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.