Code:
I have also made a query that uses the Job_ID on that form and counts how many times that ID appears in the workdays table.
As I said here June I have that part working. I said it in the thread you linked to and here. That's not the question.
I already have the ability to get the number of days assigned to a job. That's in its own query..
I don't know how to use that query on my form. I want to use that value to name days automatically.
In the last part of my post there I describe what I want to do with that value after I get it on the form. I want to add 1 to the number and put the word days before it.
I don't need to save the generated number anywhere..
My query will use the Job_ID on that form and counts the associated days.. all I need is the query result to be put there.
I'm assuming its the row source I need to change. So I can include that, and ill include the sql for the query.. I don't know if that's what I need to put together this is the purpose of the question.
Row source of the sub form: (this does not have the job ID on its the main form that does. but its where I want the number)
Code:
SELECT [Workdays].[Day_ID], [Workdays].[Staff_ID], [Workdays].[Day_Title], [Workdays].[Scheduled_Start], [Workdays].[Additional_Information], [Workdays].[Consecutive_Days], [Workdays].[Job_ID], [SiteT].[Site_Name] FROM (SiteT INNER JOIN JobT ON [SiteT].[Site_ID] =[JobT].[Site_ID]) INNER JOIN Workdays ON [JobT].[Job_ID] =[Workdays].[Job_ID];
Query:
Code:
SELECT Workdays.Job_ID, Count(Workdays.Day_ID) AS CountOfDay_ID
FROM Workdays
GROUP BY Workdays.Job_ID
HAVING (((Workdays.Job_ID)=[Forms]![JobF]![JOBID]));