In a project I'm working on (not done by me), I'm going through all the queries to see what they do, and to document them one by one to learn how everything works together.
The SQL code for the query is this:
INSERT INTO tblResponses ( QstnID, RspnsID, Rspns )
SELECT DISTINCTROW tblQuestions.QstnID, [Forms]![frmSurveyResponses]![RspnsID] AS RspnsID, tblQuestions.RspnsDefault
FROM tblQuestions
WHERE (((tblQuestions.SrvID)=[Forms]![frmSurveyResponses]![cboSrvID]));
I'm very new to this, and I can understand basically that this query is inserting a record into the table tblResponses (it's probably being called by someone else, or some VB code), and also selecting some fields from tblQuestions.
Questions:
1) I have not come across the syntax [Forms]![frmSurveyResponses]![RspnsID]. Where can I read up more about this? I'm guessing this is reading some data from a form named 'frmSurveResponses' and a field named 'RspnsID'?
2) There is an equality test for [Forms]![frmSurveyResponses]![cboSrvID]. Ok, so I go and open up the form named frmSurveyResponses, but how do I locate which control is "cboSrvID"? How do I search for this field and it's identification?
3) The 'Insert' command in the SQL code above does not have any 'Values' that follow. So what is it inserting?
Thanks!