search By 2 Condtions in Subform

xeen20

Registered User.
Local time
Today, 14:31
Joined
Aug 9, 2007
Messages
40
Hi ,
I am new to Access, i have a problem in searching my database,
I have a table name Called: details
Coulmns or Feilds are
FirstName--------LastName------Title ----............
x ----------------y-----------123 -------.......
x---------------- y-----------343-------......
z ----------------x ----------2223-----.......
x-----------------z ----------376-------.........

i need to Show the other feilds in the subform .
when the search is by First Name and Last Name in combo box.
from the above table
if my first name and last name are x and y respec
the it shoud show in subform as..
Title----...........
123 ....................
343 ......................

I am attaching my Database file.
 

Attachments

FirstName--------LastName------Title ----............
x ----------------y-----------123 -------.......
x---------------- y-----------343-------......
z ----------------x ----------2223-----.......
x-----------------z ----------376-------.........
from the above table
if my first name and last name are x and y respec
the it shoud show in subform as..
Title----...........
123 ....................
343 ......................
From what I can see, this is exactly what's happening right now for you when you change the value in your combo. I don't see what the problem is.

You are requerying the subform on change of the value....doesn't this answer the question?? Or are you wanting maybe to add another box for the last name?? If this is the case, you shouldn't have any problem. You've already set the first name combo up wonderfully!!
 
Thanks for the Reply

But i would like to have only one combo box which shows firstname and lastname,

and give the required results in sub form

I am attaching the databased i tried
In this data base i combine firstname and lastname in the combo box and tried to fill the first name and last name using recordset but i failed .

COuld u help me
 

Attachments

You would probably want a list box for displaying both names, but see what you can get from this....
 

Attachments

Thank You , As of now what u gave me is working, But what if i wanna see both Firstname and Lastname in on combo box, is there any way...
 
Unfortunately, ajetrumpet zip file won't open for me, I have access 2000.

One solution is to create a query (in the Queries pane) with a unique id for each person, the last name, and first name. Column 1 of the query would be the unique id and column 2 of th query would contain the following code (sort ascending) in the query:
Code:
Expr1: [last] & " " & [first]
(First and last can be flipped of course)

Use the Query as the row source for your combobox. Please note you will have two columns in the combobox. One column will be the unique id, from which you do your searches. If you don't have a unique key, searching will be a bit more difficult. The second column will be the display name of first and last name.
 
So,

You can do it that way too if you like. Remember that you can manipulate the display of data in any column by way of the query. There would be no need for databases if you couldn't query anything....use it!! :)

Maybe something like this....??
 

Attachments

Thanks Ortaias, But the Ajetrumpet Help Revised 2.zip worked for me. Thanks ...
 

Users who are viewing this thread

Back
Top Bottom