Issues with Calculated Field

JohnnyBQue

Registered User.
Local time
Today, 11:21
Joined
Oct 31, 2014
Messages
25
This is probably an issue that I see the solution to, but don't because it's right under my eye's...but here's the stump...
Got one Record, one Query supporting one Form...it's just the basic employee data base with the key field being 'EmployeeID". I have a field in the table called "HireDate" which is used in the Query ending up in the form. got no issues with anything every things working as it should. I wanted to enter a unbound text box in the form to generate the years an employee has worked. I used the unbound text box because when I tried to generate a calculated field in the table I kept getting an error because the expression (Round(DateDiff("d",[HireDate],NOW())/365.25,2) wasn't supported because of "DateDiff" I think the expression supported is "DateSerial". SO I made a Query to calculate the the years employed using "EmployeeID" in one column and the "round" expression above and it works just fine. I get the result I need, EmployeeID with the years worked in the next column.
My problem now is getting this result to the unbound text box in the form. I can't get the data to appear when the information for a particular employees is retrieved (by "EmployeeID" or "FullName" which is generated in the Query). This may be a SQL solution I haven't looked into that as of yet and will be doing so while I wait for any suggestions,

Thanks guys
 
Calculated fields can affect the form's query depending on how they are used.

Drop the caculated field on the query.
Try to populate the form (unbound) minus the caculated fields, like a normal table or query.

Once the form refreshes, the Hire date is available on the form's text box.
In a Read-Only Text or Lable - read the value of the text box, use the formula, display the time. This can be an event on the form update or even the Hire Date's update.
In a nutshell, the Calculated value is being done at the form level, not in a query.
 
Lets tagged this a resolved ...I think my biggest problem here is TMI....I'm going to re-post my question in a very simple format and see how it goes from there...

Thanks guys
 

Users who are viewing this thread

Back
Top Bottom