The attached code works great, it has error correction but I believe it needed another error skipping code to be added to the current code.
Here is the Intro.
The attached code selects distinct CustomerID from tblCustomer and finds if record for the selected CustomerID exist in tblW, if it finds records that matches, then, it extracts the record from tblW and populate it to an Excel file....
Flaw:
Current code does "not" skip CustomerID with no matching records in tblW. It infact stop the code from creating
other CustimerID Excel file with matching record in tblW.
New request:
If the code selects distinct CustomerID from tblCustomer and:
a). finds "no record" in tblW that matches the CustomerID and / Or
b). if it finds records that matches the CustomerID in tblW but finds that the CustomerID does "not fulfil"
the required "Criteria" in "qryCerts" or "mysql" (whatever is being used in the code in populating
the Excel file)...then do the following:
1). skip the particular CustomerID with flaws in (a) and (b) and GOTO the next CustomerID that fulfils
the Criteria "and save the exile file" in folder as currently designed in the code.
Else........
Do not create an Excel file for CustomerID with no matching records in tblW and / or that the
CustomerID did not fulfil the stipulated criteria in the "mysql" or "qryCerts"
2). Since the code loops until for each customerID in tblCustomer, I want the code to continue to "skip"
no matching record CustomerID and go to the next customerID until all customerId(s) in tblCustomer
have been processed in tblW.
3). Close application when all necessary excel files have been created successfully - this is already
defined in the code.
Specified Criteria in "qryCerts or mysql" - shown below (if needed):
For example:
If CustomerID is "147" then all jobs performed by Customer with ID "147" that meets the
following criteria would be:
(i) only all records that are between BeginDate and Enddate; AND
(ii). only records that are "RR" Or "RP" type AND
(iii). only records that are "DM" type AND
(iv). only records that are "Application" or "NoPermit"
(v) only records in which ConnSizeID are less than 2; and ServiceSizeID are less than 2 or equal to 2
Start Free Trial