HELP!! - Form Open

G

Guest

Hi to anyone that can help

I would like to do the following:

I have a popup form that has a parameter query. The user types in a stockNo
and then the query brings back the details in the popup form with the details
for that stockno.

But if there is no such stockno so no record to display it just displays a
blank popup form with nothing at all in it.

How can I stop that blank form from being displayed? I have tried some code
in the form open but it just says the field or the form as no value so does
nothing just brings up errors.

Is there a way of doing this... if so would really appreciate so help here.

Thanks in advance.
 
M

[MVP] S.Clark

Create a form that allows the user to select a stock no from a combobox.
Trick is, restrict the values to only those that have records to display.
 
G

Guest

But the form I have for this runs from a query that has a parameter. I want
the user to enter the stock no and it only shows that.

Is there a way of restricting the parameter entry or can the parameter have
a list to choose from like a combo box?

More help needed here..thanks ;o)
 
G

Guest

I got here from you most recent request for additional help. S. Clark
answered your question. Perhaps you need more detail.

To be able to enter a parameter value for a query, you will need to do it
programmatically using VBA, you can enter something like [Enter Stock No:] in
the criteria for the field you want the parameter set on, or you can set the
criteria in the query to a control on a form in the query builder.

What you need to do is put a combo box on the form that calls the query.
Use a query that will return a list of the stock numbers for the row source
of the combo. Set the NotInList property to No. Use the After Update event
of the combo box to return the record you want.
 
G

Guest

thanks... will try and give it a go... was hoping I could do it with using
the parameter query I already have, but take it wont be able to... need a
combo box.

Thanks for getting back to me!

Saj

Klatuu said:
I got here from you most recent request for additional help. S. Clark
answered your question. Perhaps you need more detail.

To be able to enter a parameter value for a query, you will need to do it
programmatically using VBA, you can enter something like [Enter Stock No:] in
the criteria for the field you want the parameter set on, or you can set the
criteria in the query to a control on a form in the query builder.

What you need to do is put a combo box on the form that calls the query.
Use a query that will return a list of the stock numbers for the row source
of the combo. Set the NotInList property to No. Use the After Update event
of the combo box to return the record you want.

Saj said:
But the form I have for this runs from a query that has a parameter. I want
the user to enter the stock no and it only shows that.

Is there a way of restricting the parameter entry or can the parameter have
a list to choose from like a combo box?

More help needed here..thanks ;o)
 
M

[MVP] S.Clark

In your query, CHANGE your parameter to reference the combobox.

Forms!formname!comboboxname

instead of

[Enter Stock No]
 

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