Continuous Form question

J

Jasper Recto

I have a continous form that displays the results of a query. The criteria
for this query is a part number.

I would like to have on that form a text field where you can enter in the
part number and use that field to run the query against

I can't seem to get this to work.

I created the field and linked a button to launch the query but the query
opens in its own window. The original form does not refresh with the new
part number.

What am I doing wrong?

Thanks
Jasper
 
S

schasteen

You do not want to open the query, but requery the datasource for your form.
Instead of opening the query put:
Me.requery
 
K

Ken Sheridan

Jasper:

I assume that you are referencing the unbound text box on the form as a
parameter. In which case all you have to do is requery the form in the
button's Click event procedure with:

Me.Requery

Have you considered using a combo box rather than a text box so that the
user can select a part number from the list? The combo box's RowSource would
be something like this:

SELECT [PartNumber] FROM [Parts] ORDER BY [PartNumber];

Where parts is a table with one row per part.

Ken Sheridan
Stafford, England
 
J

Jasper Recto

I thought of a combo box but we have over 8000 parts. It might be to
confusing.

Thanks!
Jasper

Ken Sheridan said:
Jasper:

I assume that you are referencing the unbound text box on the form as a
parameter. In which case all you have to do is requery the form in the
button's Click event procedure with:

Me.Requery

Have you considered using a combo box rather than a text box so that the
user can select a part number from the list? The combo box's RowSource
would
be something like this:

SELECT [PartNumber] FROM [Parts] ORDER BY [PartNumber];

Where parts is a table with one row per part.

Ken Sheridan
Stafford, England

Jasper Recto said:
I have a continous form that displays the results of a query. The
criteria
for this query is a part number.

I would like to have on that form a text field where you can enter in the
part number and use that field to run the query against

I can't seem to get this to work.

I created the field and linked a button to launch the query but the query
opens in its own window. The original form does not refresh with the new
part number.

What am I doing wrong?

Thanks
Jasper
 
D

Douglas J. Steele

Take a look at what Allen Browne has at
http://www.allenbrowne.com/ser-32.html

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Jasper Recto said:
I thought of a combo box but we have over 8000 parts. It might be to
confusing.

Thanks!
Jasper

Ken Sheridan said:
Jasper:

I assume that you are referencing the unbound text box on the form as a
parameter. In which case all you have to do is requery the form in the
button's Click event procedure with:

Me.Requery

Have you considered using a combo box rather than a text box so that the
user can select a part number from the list? The combo box's RowSource
would
be something like this:

SELECT [PartNumber] FROM [Parts] ORDER BY [PartNumber];

Where parts is a table with one row per part.

Ken Sheridan
Stafford, England

Jasper Recto said:
I have a continous form that displays the results of a query. The
criteria
for this query is a part number.

I would like to have on that form a text field where you can enter in
the
part number and use that field to run the query against

I can't seem to get this to work.

I created the field and linked a button to launch the query but the
query
opens in its own window. The original form does not refresh with the
new
part number.

What am I doing wrong?

Thanks
Jasper
 
J

Jeanette Cunningham

Jasper,
if you can include the part number in the record source for the form, it is
an easy way to get the value on to the form.
Another possiblity is to use a DLookup to get the value for the part number.
Here is an explanation of DLookup
http://allenbrowne.com/casu-07.html


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top