I changed the name of the PrimaryID field to PriID (to see if it was
something to do with the PrimaryID name being reserved) and it still doesn't
work. Here is the SQL:
SELECT Questions.TypeNum, Questions.GroupNum, Questions.SubGroupNum,
Questions.QuestionNum, Questions.Type, Questions.Group, Questions.SubGroup,
Questions.Question, Questions.Points, Questions.StartDate, Questions.EndDate,
[Forms]![PREAUDIT]![PriID] AS Expr1
FROM Questions
WHERE (((Questions.TypeNum)=[Forms]![PREAUDIT]![AUDITTYPE]));
You can see it compares the TypeNum field from the Questions table to the
AuditType of the PreAudit form and returns all questions that match. It is
supposed to also place the PrimaryID of the record (PriID) from the source
form at the end of the query. Instead, it returns a square.
I'm trying to have the user enter data into an Audit table (User, Date, Type
of Audit, etc.). Once that is entered, I'm trying to have the database pull
the applicable questions from the Questions table and append them to an
AuditResult table. I will then open up a form based on the Audit table with
a subform based on the AuditResult table where the PrimaryID's match
(allowing the user to then update the results of the audit).
I need to get the PrimaryID (PriID) field from the 1st form to list as the
last field in the query. What am I doing wrong?
Keep in mind that I am using the QBE grid, as our company doesn't permit
coding directly in SQL.
THX!
> Can you confirm the SQL as I would expect the where clause to reference the
> combo and not the Primary ID
[quoted text clipped - 49 lines]
> >
> > THX!
Robert_L_Ross - 13 May 2005 20:41 GMT
NEVERMIND! I found it. For some reason, I had to specify a parameter of
"[Forms]![PREAUDIT]![PriID]" as double.
I always thought you only needed that when the field you were returning was
entered by a user - not from the table. Anyway, I added that parameter and
it worked like a charm (so all you other newbies, here's a note to remember).
JohnFol, thx for the help, making me go back to the SQL gave me the idea to
try that, so I'm still giving u credit for the answer, hehe
> I changed the name of the PrimaryID field to PriID (to see if it was
> something to do with the PrimaryID name being reserved) and it still doesn't
[quoted text clipped - 79 lines]
> > >
> > > THX!