I need to update a history table with the results of a query that is run from input on a form in access. the query is tying a bunch of data together and giving me all the information I want. The problem is I am not sure on how to code in VB to access the results of the query. I can run the query --
stDocName = "qryrptall"
DoCmd.OpenQuery stDocName, acNormal, acEdit
but then how do I access the specific fields and load them into a table???
This is the query:
SELECT tblRptAll.Owner, tblHeader.Field1, tblHeader.Field2, tblRptAll.ExporterName, tblExporter.[Exporter Address1],tblExporter.[ExporterCity, State Zip], tblExporter.[ExporterTaxID Number], tblRptAll.StartDate, tblRptAll.EndDate, tblRptAll.ProducerName, tblVendors.ProducerStreetAddress1, tblVendors.ProducerCityStateZip,
tblVendors.ProducerTaxID, tblRptAll.ImporterName,
tblCustomers.CustomerAddress1,tblCustomers.CustomerCityStateZip, tblCustomers.CustomerTaxIDNumber, tblRptAll.Min,
tblproducts.ProductDescription, tblproducts.HSDescription,
tblproducts.HSTariffCode, tblproducts.PreferenceCriterion,
tblproducts.Producer, tblproducts.NetCost, tblproducts.CountryofOrigin, tblRptAll.Name, tblAuthor.Company, tblAuthor.Title, tblAuthor.Voice, tblAuthor.Fax, tblRptAll.CurDate, tblRptAll.Pages, tblRptAll.DocumentNo
FROM (((((tblRptAll INNER JOIN tblHeader ON tblRptAll.Owner = tblHeader.ID) INNER JOIN tblExporter ON tblRptAll.ExporterName = tblExporter.[Exporter Name])
INNER JOIN tblCustomers ON tblRptAll.ImporterName = tblCustomers.CustomerName) INNER JOIN tblproducts ON (tblRptAll.Owner = tblproducts.SelectHeader) AND
(tblRptAll.Min = tblproducts.MIN)) INNER JOIN tblAuthor ON tblRptAll.Name = tblAuthor.Name) INNER JOIN tblVendors ON tblRptAll.ProducerName = tblVendors.ProducerName;
The form provides all the tblrptall data.
Any help would be appreciated....
stDocName = "qryrptall"
DoCmd.OpenQuery stDocName, acNormal, acEdit
but then how do I access the specific fields and load them into a table???
This is the query:
SELECT tblRptAll.Owner, tblHeader.Field1, tblHeader.Field2, tblRptAll.ExporterName, tblExporter.[Exporter Address1],tblExporter.[ExporterCity, State Zip], tblExporter.[ExporterTaxID Number], tblRptAll.StartDate, tblRptAll.EndDate, tblRptAll.ProducerName, tblVendors.ProducerStreetAddress1, tblVendors.ProducerCityStateZip,
tblVendors.ProducerTaxID, tblRptAll.ImporterName,
tblCustomers.CustomerAddress1,tblCustomers.CustomerCityStateZip, tblCustomers.CustomerTaxIDNumber, tblRptAll.Min,
tblproducts.ProductDescription, tblproducts.HSDescription,
tblproducts.HSTariffCode, tblproducts.PreferenceCriterion,
tblproducts.Producer, tblproducts.NetCost, tblproducts.CountryofOrigin, tblRptAll.Name, tblAuthor.Company, tblAuthor.Title, tblAuthor.Voice, tblAuthor.Fax, tblRptAll.CurDate, tblRptAll.Pages, tblRptAll.DocumentNo
FROM (((((tblRptAll INNER JOIN tblHeader ON tblRptAll.Owner = tblHeader.ID) INNER JOIN tblExporter ON tblRptAll.ExporterName = tblExporter.[Exporter Name])
INNER JOIN tblCustomers ON tblRptAll.ImporterName = tblCustomers.CustomerName) INNER JOIN tblproducts ON (tblRptAll.Owner = tblproducts.SelectHeader) AND
(tblRptAll.Min = tblproducts.MIN)) INNER JOIN tblAuthor ON tblRptAll.Name = tblAuthor.Name) INNER JOIN tblVendors ON tblRptAll.ProducerName = tblVendors.ProducerName;
The form provides all the tblrptall data.
Any help would be appreciated....