View Full Version : urgent query help


janed
02-13-2002, 02:11 AM
i want to make a query that asks me two questions at once. if for example it asks me for a first name and a second name and i enter both then i want it to sow ALL fields that contain those names. however, i want it to ask me these questions at once, not as two seperate parameter boxes. pls help

adz2013
02-13-2002, 04:05 AM
do you mean first name and last name?

janed
02-13-2002, 05:06 AM
yes but these are only examples. i am actually looking for a room number and a port number. i was also wondering if anyone knew how to put two reports on the one page.

adz2013
02-13-2002, 05:11 AM
As far as the query I would make a unbound form and enter the port # and room # on the form and have the query run off of the form. In the criteria of the query type Forms![Formname]![controlname]. That should work. You will need to put this in both fields in the query in the criteria.

HTH

janed
02-13-2002, 05:18 AM
thank you. i actually have just done that and its working reasonably well! now my next proble is that i need an old port number and a new port number which will require two different queries. i was wondering if i could put them in the same report.

adz2013
02-13-2002, 05:20 AM
can you explain a little more? I don't fully understand.

janed
02-13-2002, 05:30 AM
in my main table i have a field for port number and a field for room number, it is sometimes the case that people move room or port. i need a query to ask me for the room number and the port number and to give me a report on that(i have this done) but i then need it to ask me again, say for a new room number, and i need a report on that too. but i want to put these two reports on the one page.

adz2013
02-13-2002, 05:32 AM
I am not sure how to do that. Sorry!

directormac
02-13-2002, 05:40 AM
Two subreports, side by side, each 1/2 the width of the main report.

--Columned Mac

janed
02-13-2002, 05:54 AM
if i use a sub report for each one is the main report effectively blank?
as i said i have a dialog box that asks for the room number and port number and gives me a report. however now it is giving me a report with no values, only field names. any ideas why?

directormac
02-13-2002, 07:03 AM
Let's back up a second... How are the old port number and new port number stored? What is this report showing you? In other words, I'm looking for some more info on your table structures... You said you had "a field for port number and a field for room number", are those fields part of a larger record structure, such as the user's info? Maybe easiest just to e-mail me your .mdb file if it's not too large...

--Fuzzy Mac

[This message has been edited by directormac (edited 02-13-2002).]

janed
02-13-2002, 07:24 AM
the fields are part of a table containing other information.

directormac
02-13-2002, 07:36 AM
Are "old port" and "new port" separate fields? Or do you replace "old port" with "new port" in a single "PortID" field? Are the values stored in this/these fields linked to a separate "ports" table?

What's the focus of the two reports, are they about the rooms, the ports, or the user? I'm guessing it's something like:

USER: xxx

OLD PORT NEW PORT
-------- --------
Port # Port #
Room 1 Room 2

Is that what you want?

[This message has been edited by directormac (edited 02-13-2002).]

[This message has been edited by directormac (edited 02-13-2002).]

directormac
02-15-2002, 05:30 AM
Well, without further clarification on what you're facing, I'd guess that at some point you've got a form open that will allow you to capture both the old port ID and the new port ID in text fields. At that point you can create a new query with critera like "(PortID = Forms!ThatForm!txtOldPort) OR (PortID = Forms!ThatForm!txtNewPort)" and print them in a 2-column subreport/subform, or you can have two side-by-side subreports/subforms which are driven by the boxes separately. There's almost certainly a better way... Rich or Pat or one of the other AccessGods may know (they may have even mailed you off-list already, since you mentioned it was urgent). I hope you got it working.

--Chagrined Mac