P
PayeDoc
Hello All
I have the make-table query below, which runs as part of the OnClick event
of a button. Sometimes the query will return no records (i.e. no records are
added to the table [hours per week]). When the query does return 1 or more
records I need to initiate another action (display a messagebox and run two
further queries). How do I do that?
Hope someone can help.
Many thanks
Leslie Isaacs
The query:
SELECT staffs.practice, staffs.person, staffs.[nml hourweek going],
Sum(stafpay.number) AS SumOfnumber, stafpay.normal, stafpay.[month name]
INTO [hours per week]
FROM staffs INNER JOIN stafpay ON staffs.person = stafpay.person
WHERE (((stafpay.paytyp)="hrs/wk" Or (stafpay.paytyp)="ex hrs/wk"))
GROUP BY staffs.practice, staffs.person, staffs.[nml hourweek going],
stafpay.normal, stafpay.[month name]
HAVING (((staffs.practice)=[Forms]![frm x main]![prac name]) AND
((Sum(stafpay.number))<>[nml hourweek going]) AND ((stafpay.normal)=True)
AND ((stafpay.[month name])=[Forms]![frm x main]![month name]));
I have the make-table query below, which runs as part of the OnClick event
of a button. Sometimes the query will return no records (i.e. no records are
added to the table [hours per week]). When the query does return 1 or more
records I need to initiate another action (display a messagebox and run two
further queries). How do I do that?
Hope someone can help.
Many thanks
Leslie Isaacs
The query:
SELECT staffs.practice, staffs.person, staffs.[nml hourweek going],
Sum(stafpay.number) AS SumOfnumber, stafpay.normal, stafpay.[month name]
INTO [hours per week]
FROM staffs INNER JOIN stafpay ON staffs.person = stafpay.person
WHERE (((stafpay.paytyp)="hrs/wk" Or (stafpay.paytyp)="ex hrs/wk"))
GROUP BY staffs.practice, staffs.person, staffs.[nml hourweek going],
stafpay.normal, stafpay.[month name]
HAVING (((staffs.practice)=[Forms]![frm x main]![prac name]) AND
((Sum(stafpay.number))<>[nml hourweek going]) AND ((stafpay.normal)=True)
AND ((stafpay.[month name])=[Forms]![frm x main]![month name]));