I am trying to insert some data into a table and am not qetting very far!!!
I have two table TblReqirements and TblChecklist
TblRequirements has the following structure
ReqNo (AutoNo)
TeamRefNo (Number)
ReqDetail (Text)
Redundant (Yes/No)
Basically this table holds the Requirements for various teams
Typical data would be
[tt]
ReqNo TeamRefNo ReqDetail Redundant
1 1 Create Backup Stratergy False
2 1 Aquire enough tapes True
3 2 Procure Hardware False
4 2 Procure Software False
5 3 Build Workstations False
6 4 Install Software False
[/tt]
The second table TblChecklist has the following structure
CheckID (AutoNo)
ProjectID (Text)
ReqNo (Number)
In my application a project is created and the user selects teams that are required for the project. I then need to create a checklist which will consist of a list of (current) requirements for the teams selected. Current are denoted as not being redundant
So for example, if a user selects teams 1 and 3 for project Z1234 the following needs to be inserted into TblChecklist
[tt]
CheckID ProjectID ReqNo
Z1234 1
Z1234 5 (The CheckID would be AutoNumbered)
[/tt]
Using the SQL Statement
INSERT INTO TbleChecklist (ReqNo)
SELECT TblRequirements.ReqNo
FROM TblRequirements
WHERE (((TblRequirements.TeamRefNo)=[TeamNo]) AND ((TblRequirements.Redundant)=False));
will do half the job ..... I get
[tt]
CheckID ProjectID ReqNo
1
5 (The CheckID would be AutoNumbered)
[/tt]
How do I get it to insert the ProjectID which is taken from a field in a form?
Any help appreciated!!!!
I have two table TblReqirements and TblChecklist
TblRequirements has the following structure
ReqNo (AutoNo)
TeamRefNo (Number)
ReqDetail (Text)
Redundant (Yes/No)
Basically this table holds the Requirements for various teams
Typical data would be
[tt]
ReqNo TeamRefNo ReqDetail Redundant
1 1 Create Backup Stratergy False
2 1 Aquire enough tapes True
3 2 Procure Hardware False
4 2 Procure Software False
5 3 Build Workstations False
6 4 Install Software False
[/tt]
The second table TblChecklist has the following structure
CheckID (AutoNo)
ProjectID (Text)
ReqNo (Number)
In my application a project is created and the user selects teams that are required for the project. I then need to create a checklist which will consist of a list of (current) requirements for the teams selected. Current are denoted as not being redundant
So for example, if a user selects teams 1 and 3 for project Z1234 the following needs to be inserted into TblChecklist
[tt]
CheckID ProjectID ReqNo
Z1234 1
Z1234 5 (The CheckID would be AutoNumbered)
[/tt]
Using the SQL Statement
INSERT INTO TbleChecklist (ReqNo)
SELECT TblRequirements.ReqNo
FROM TblRequirements
WHERE (((TblRequirements.TeamRefNo)=[TeamNo]) AND ((TblRequirements.Redundant)=False));
will do half the job ..... I get
[tt]
CheckID ProjectID ReqNo
1
5 (The CheckID would be AutoNumbered)
[/tt]
How do I get it to insert the ProjectID which is taken from a field in a form?
Any help appreciated!!!!