pedromac73
New member
- Local time
- Today, 14:22
- Joined
- Jan 29, 2007
- Messages
- 7
Hope you can help, I have searched the forums but cannot find anything that will serve my needs but if you know can you guide me to the relevant place it would be appreciated.
I am trying to create an auto invoicing system that will create a new invoice after a date has been updated within the current record but the data will go into 2 tables for Invoice and Invoice Details. This will be applied to several date fields within the record.
The fields required on the current record:-
tblCandidates
lngCandidateID
strCandidateFirstName
strCandidateLastName
lngClientID
tblCourseRegistrations
lngCourseRegID
lngCandidateID
lngCourseID
lngTAID
strCourseRegSkillDate (afterupdate command to create auto invoice)
tblServices
lngServiceID
The fields being updated:-
tblInvoices
strInvoiceDesc = (strCandidateFirstName & strCandidateLastName)
(Concatenated from tblCandidates)
dtmInvoiceDate = tblCourseRegistrations.strCourseRegSkillDate
lngClientID = tblCandidates.lngClientID
lngCourseID = tblCourseRegistrations.lngCourseID
lngTAID = tblCourseRegistrations.lngTAID
tblInvoiceDetails
lngServiceID = tblServices. lngServiceID
(This will change as a default depending on the date field being updated i.e. skilldate = 1, 1stvqdate=2, additionalvq=3)
I have tried using an append query but cannot get it to go into the second table so I believe that VBA would be best.
INSERT INTO
tblInvoices ( lngClientID, dtmInvoiceDate, lngTAID, strInvoiceDesc )
SELECT
tblCandidates.lngClientID, tblCourseRegistrations.dtmCourseRegSkillMatchDate, tblCourseRegistrations.lngTAID, [tblCandidates.strCandidateFirstName] & " " & [tblCandidates.strCandidateLastName] AS InvoiceDesc
FROM
tblServices, tblCourses INNER JOIN (tblCandidates INNER JOIN tblCourseRegistrations ON tblCandidates.lngCandidateID = tblCourseRegistrations.lngCandidateID) ON tblCourses.lngCourseID = tblCourseRegistrations.lngCourseID;
Kind Regards in advance
Peter
I am trying to create an auto invoicing system that will create a new invoice after a date has been updated within the current record but the data will go into 2 tables for Invoice and Invoice Details. This will be applied to several date fields within the record.
The fields required on the current record:-
tblCandidates
lngCandidateID
strCandidateFirstName
strCandidateLastName
lngClientID
tblCourseRegistrations
lngCourseRegID
lngCandidateID
lngCourseID
lngTAID
strCourseRegSkillDate (afterupdate command to create auto invoice)
tblServices
lngServiceID
The fields being updated:-
tblInvoices
strInvoiceDesc = (strCandidateFirstName & strCandidateLastName)
(Concatenated from tblCandidates)
dtmInvoiceDate = tblCourseRegistrations.strCourseRegSkillDate
lngClientID = tblCandidates.lngClientID
lngCourseID = tblCourseRegistrations.lngCourseID
lngTAID = tblCourseRegistrations.lngTAID
tblInvoiceDetails
lngServiceID = tblServices. lngServiceID
(This will change as a default depending on the date field being updated i.e. skilldate = 1, 1stvqdate=2, additionalvq=3)
I have tried using an append query but cannot get it to go into the second table so I believe that VBA would be best.
INSERT INTO
tblInvoices ( lngClientID, dtmInvoiceDate, lngTAID, strInvoiceDesc )
SELECT
tblCandidates.lngClientID, tblCourseRegistrations.dtmCourseRegSkillMatchDate, tblCourseRegistrations.lngTAID, [tblCandidates.strCandidateFirstName] & " " & [tblCandidates.strCandidateLastName] AS InvoiceDesc
FROM
tblServices, tblCourses INNER JOIN (tblCandidates INNER JOIN tblCourseRegistrations ON tblCandidates.lngCandidateID = tblCourseRegistrations.lngCandidateID) ON tblCourses.lngCourseID = tblCourseRegistrations.lngCourseID;
Kind Regards in advance
Peter