R
RoadKyng
Greetings,
I have a few forms that use unbound combo boxes to set matching criteria for
an insert query. Three tables are in work here. The combo boxes are used to
select data from [AD - Main tbl], and a query matches certain fields in the
[JSLLC Aircraft tbl] then creates a record in the [AD - Aircraft sub tbl],
using data from the first two tables. I would like to learn to perform this
type function in VB and get away from complicated queries. However I have not
located a proper command to use and am having trouble understanding some of
the code I find on this site.
My query is as follows. Is there a fairly simple method to code this in VB?
INSERT INTO [AD - Aircraft sub tbl] ( aircraftMODEL, ADnumber, ADcatagory,
ADtitle, ADinitDUEpnt, ADeffDATE, ADrecurINTRVL, REGISTRATION,
aircraftSERIALnumber, MethodofCompliance, componentMANUFACTURER,
componentDESCRIPTION, Supersedes, AcftSNin, AcftSNout )
SELECT [JSLLC Aircraft tbl].AircraftType, [AD - Main tbl].ADNumber, [AD -
Main tbl].CATAGORY, [AD - Main tbl].Title, [AD - Main tbl].intialDUEpoint,
[AD - Main tbl].EffectiveDate, [AD - Main tbl].recurringINTERVAL, [JSLLC
Aircraft tbl].Registration, [JSLLC Aircraft tbl].SerialNumber, [AD - Main
tbl].complianceMETHOD, [AD - Main tbl].manufacturer, [AD - Main
tbl].componentAPPLICABILITY, [AD - Main tbl].Supersedes, [AD - Main
tbl].acftSNrangeSTART, [AD - Main tbl].acftSNrangeEND
FROM [AD - Main tbl], [JSLLC Aircraft tbl]
WHERE ((([JSLLC Aircraft tbl].AircraftType)=[Forms]![REPORTING -
AirworthinessDirectives]![AIRCRAFTmodel]) AND (([AD - Main
tbl].ADNumber)=[Forms]![REPORTING - AirworthinessDirectives]![ADnumber]) AND
(([AD - Main tbl].CATAGORY) Not Like "ENGINE") AND (([JSLLC Aircraft
tbl].CertStatus)<>"off certificate"));
Secondly - I named these tables a few years ago before I learned proper
naming conventions. Is there a way to globally change a table name that will
affect all code, queries and forms?
Thank You
I have a few forms that use unbound combo boxes to set matching criteria for
an insert query. Three tables are in work here. The combo boxes are used to
select data from [AD - Main tbl], and a query matches certain fields in the
[JSLLC Aircraft tbl] then creates a record in the [AD - Aircraft sub tbl],
using data from the first two tables. I would like to learn to perform this
type function in VB and get away from complicated queries. However I have not
located a proper command to use and am having trouble understanding some of
the code I find on this site.
My query is as follows. Is there a fairly simple method to code this in VB?
INSERT INTO [AD - Aircraft sub tbl] ( aircraftMODEL, ADnumber, ADcatagory,
ADtitle, ADinitDUEpnt, ADeffDATE, ADrecurINTRVL, REGISTRATION,
aircraftSERIALnumber, MethodofCompliance, componentMANUFACTURER,
componentDESCRIPTION, Supersedes, AcftSNin, AcftSNout )
SELECT [JSLLC Aircraft tbl].AircraftType, [AD - Main tbl].ADNumber, [AD -
Main tbl].CATAGORY, [AD - Main tbl].Title, [AD - Main tbl].intialDUEpoint,
[AD - Main tbl].EffectiveDate, [AD - Main tbl].recurringINTERVAL, [JSLLC
Aircraft tbl].Registration, [JSLLC Aircraft tbl].SerialNumber, [AD - Main
tbl].complianceMETHOD, [AD - Main tbl].manufacturer, [AD - Main
tbl].componentAPPLICABILITY, [AD - Main tbl].Supersedes, [AD - Main
tbl].acftSNrangeSTART, [AD - Main tbl].acftSNrangeEND
FROM [AD - Main tbl], [JSLLC Aircraft tbl]
WHERE ((([JSLLC Aircraft tbl].AircraftType)=[Forms]![REPORTING -
AirworthinessDirectives]![AIRCRAFTmodel]) AND (([AD - Main
tbl].ADNumber)=[Forms]![REPORTING - AirworthinessDirectives]![ADnumber]) AND
(([AD - Main tbl].CATAGORY) Not Like "ENGINE") AND (([JSLLC Aircraft
tbl].CertStatus)<>"off certificate"));
Secondly - I named these tables a few years ago before I learned proper
naming conventions. Is there a way to globally change a table name that will
affect all code, queries and forms?
Thank You