PDA

View Full Version : eeps! don't know where to start...



philix007
10-29-2007, 12:30 PM
Hey guys n gals,

I'm trying to make a form in access that has 3 text entry fields.. part# job# and item#...
I'm trying to make it so when one of those fields are typed into, and click a button, it searches a table I have named quotesheets for specific field names m8, m7, k11. and return all of the resulting records that match that info...
then, with a box or something with the matching records up, you could click on that record and open it into an excel template that I've made for it...


any ideas?


PS> the field names in the access tables match the cells in excel that the info came from/goes into. so Cell M8 in excel is field M8 in access table.

XLGibbs
10-29-2007, 04:45 PM
Is this linked to excel? or is the table imported?

You can create a form which is linked to the table and you can design it to suit your needs (probably with the wizard first and then you can tweak it from there).

You would add the fields where you can type in the search item (in this case 3 fields) and a button for each. Behind each of those buttons you will have assign a record operation which finds the record in the data set.

THere are also ways to preset queries to look for parameters..so you could set up a query and have the criteria pointed at the form itself to see what is entered.

What have you done so far?

akn112
10-31-2007, 07:20 AM
the way i would go about this (i think was suggested by XLGibbs) would be to set up a function in one of ur modules like


public function getParameter(myparameter as string) as string
select case myparameter
case "part"
getParameter = forms!form1.txtpart.value
case "job"
getParameter = forms!form1.txtjob.value
case "item"
getParameter = forms!form1.txtitem.value
end select
getParameter = nz(getParameter,"*")
end function

then in your SQL

SELECT...
FROM...
WHERE tbl.[part] = getParameter("Part") AND tbl.[job] = getParameter("Job") AND tbl.[item] = getParameter("item")