Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening form at at a specific record

Status
Not open for further replies.

momon

Vendor
May 22, 2002
42
CA
How would i do this.

I have a form with a select query as the record source.
Each record in the query is differentiated from the other records by the
NUMBER said:
AND [ITEM NUMBER]

The
NUMBER said:
AND [ITEM NUMBER] are entered by the user at the main switchboard. The user clicks to open a certain form which has a query as the record source.

The criteria for the query is the
NUMBER said:
. So the form opens with a given
NUMBER said:
at [ITEM NUMBER] = 1.
There are many [ITEM NUMBER]s corresponding to each
NUMBER said:
.

Now my question is: How would I open the from at a specific [ITEM NUMBER]?

If I specify the query to look for both the
NUMBER said:
AND [ITEM NUMBER], I get one specific record. This is NOT what i want.

-----------------

For example,
NUMBER said:
= 0001 has 4 items.
The user enters at the main switch board,
NUMBER said:
= 0001 and [ITEM NUMBER] = 3.

I want to open the form at
NUMBER said:
= 0001 and [ITEM NUMBER] = 3. Meanwhile, the user can still press the previous record button to go back to [ITEM NUMBER] = 2 or press the next record button to go forward to [ITEM NUMBER] = 4



Thanks
 
You should base the form on a query pointing to the
NUMBER said:
from the main switchboard. In the query,
NUMBER said:
the field critiera should be

[forms]![SWITCHBOARD FORM NAME]!
NUMBER INPUT FIELD NAME said:
On the same CRITERIA LINE, under [ITEM NUMBER] enter "3"

Then, on a 2nd CRITERIA LINE for
NUMBER said:
re-enter

[forms]![SWITCHBOARD FORM NAME]!
NUMBER INPUT FIELD NAME said:
What this does is give you a query with ITEM #3 at the top and then all other items for this QUOTE.

Hope this helps.

Jim "Get it right the first time, that's the main thing..." [wavey]
 
hmm... for some reason the post above doesn't seem to work.

I have in the query, [forms]![SWITCHBOARD FORM NAME]!
NUMBER INPUT FIELD NAME said:
under the
NUMBER said:
field.

However, I want the form to display a certain [ITEM NUMBER] for the given
NUMBER said:
. There are multiple [ITEM NUMBER]s corresponding to each
NUMBER said:
.
-----
For example,
NUMBER said:
= 0001 has 4 items.
The user enters at the main switch board,
NUMBER said:
= 0001 and [ITEM NUMBER] = 3 (arbitrarily selected, it could have equally well been 1, 2, or 4).

I want to open the form at
NUMBER said:
= 0001 and [ITEM NUMBER] = 3 (corresponding to the [ITEM NUMBER] specified in the switchboard by the user). Meanwhile, the user can still press the previous record button to go back to [ITEM NUMBER] = 2 or press the next record button to go forward to [ITEM NUMBER] = 4

NOTE:
I do NOT want to specify a criteria for both
NUMBER said:
and [ITEM NUMBER] since this will produce one record, and not enable the user to scroll to the other [ITEM NUMBER]s for a given quote number.
 
If you set 2 lines of criteria as suggested, you will get what you're looking for.

Respond to this by pasting in the actual SQL from your query, and give me the basic table layout. I'll play around with it for you and send it back.

Jim "Get it right the first time, that's the main thing..." [wavey]
 
thanks for your help jim.

ok here is the table layout... i'll try to explain things the best i can.

there are two tables in the upper query window.
They are: ORDER and WSPECS
Between these two tables there are 'joins' between:
1)
NUMBER said:
in the ORDER table and
NUMBER said:
in the WSPECS table
2) [ITEM NUMBER] in the ORDER table and [ITEM NUMBER] in the WSPECS table

In the main switchboard, the two text fields,
NUMBER said:
AND [ITEM NUMBER] are bound to the WSPECS table.

-------

so basically here is what my query screen looks like
______________ ______________
|ORDER | | WSPECS
|QUOTE NUMBER |------ |QUOTE NUMBER
|ITEM NUMBER |-------| ITEm NUMBER
|... etc | |... etc
--------------- ---------------

----------------------------------------------------------

Field QUOTE NUMBER ITEM NUMBER
Table ORDER ORDER
Sort
Show yes yes
Criteria [Forms]![Start]!
NUMBER said:
Or

NOTE: Start is the name of the switchboard form.

I also tried this suggested by JIm

Field QUOTE NUMBER ITEM NUMBER
Table ORDER ORDER
Sort
Show yes yes
Criteria [Forms]![Start]!
NUMBER said:
3
OR [Forms]![Start]!
NUMBER said:
but it doesn't seem to work...

also... i tried this

Field QUOTE NUMBER ITEM NUMBER
Table ORDER ORDER
Sort
Show yes yes
Criteria [Forms]![Start]!
NUMBER said:
[Forms]![Start]![ITEM NUMBER]
OR [Forms]![Start]!
 
Having your criteria for
NUMBER said:
be [Forms]![Start]!
NUMBER said:
and for [ITEM NUMBER] be [Forms]![Start]![ITEM NUMBER] gets you only the records where both numbers equal the iput items. You know this already.

After going crazy with this for the past 2 hours, I'm almost positive that your query needs only 1 criteria for
NUMBER said:
= [Forms]![Start]!
NUMBER said:
. This leaves the problem of getting your form to display the exact ITEM number, which involves some "sort" or "record pointing" code that I don't know.

I'm sure that one of the wizards who frequent this site will be able to help you much better than I can.

I'm at a loss. Sorry to have wasted your time and to have gotten your hopes up.

I flagged this for email notification because if this is ever solved, I'd really like to know the solution.

Good luck!

Jim :-(
"Get it right the first time, that's the main thing..." [wavey]
 
hey man... need not be sorry... you were generous enough to try and listen to my problem... and i am greatly thankful...


i'll tell you if it ever gets resolved...
thanks again for your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top