search form and subform

G

Guest

I have a database that has 70,000 parts and what i have a form that has a
text box that when you type in the part number and hit enter it would
populate the other 20 fields of info related to that part and also i want to
put a subform on that page that will be attached ot the same table and or
query to do invoices, p.o.'s. qoutes, and packing slips from the same part
info, what i want to do in short is be able to search for a parts and create
invoices and stuff on the same form using fields from a customes query or
table to fill in the customer data automatically, and a subform to list the
part number and description and price my problem is i cant get the search
part to fill in all the fields and the subform to do what it needs.
 
G

Guest

I had to do something similar last year

I was creating a search form where you enter your search in the top of the
form and results appeared below.

I have a unbound text box in the header of my form which is based on a query.
and in the underlying query I had the following
Like "* " & [Forms]![artsearchkeyword]![descriptionkey] & "*"
in the criteria field

Create a query that has all 20 odd part details fields in it
then in your search query put as criteria under "part number"

Like "* " & [Forms]![namee-of-form]![partnumber-lookup]

then create a firm based on this query.
Put a blank field in the header of this form and in its properties
properties>other>name
give it something like partnumber-lookup

The last part is a macro
This macro has action = requery
I have a button that has in it's properties>events>onclick = name of macro
just mentioned).
This means I type values into the field(s), click the button and the search
results appear


The only problem I have with this method is I have to have a default value
in one of the unbound fields (I have used a value that can not exist
normally like jjjjj) This is because the form runs the underlying query when
opened. When opened it was coming up with all records but worked ok after
that point.

The last part is a macro
This macro has action = requery
I have a button that has in it's properties>events>onclick = name of macro
just mentioned).
This means I type values into the field(s), click the button and the search
results appear

That should get the parts number search going for you.

:
 

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