Date Diff expression not behaving on my form (1 Viewer)

Sana210

New member
Local time
Today, 11:17
Joined
Jul 16, 2013
Messages
5
Hi
I use MS Access from time to time to build simple databases. These days I have progressed on to create a few complex ones (at least for me)

I am trying to calculate the date difference between two fields which are in two differnt tables.This is a calculated field I want on the form only. So I have used the following expression in the control source but it does not seem to work. Please help me

=DateDiff("d",[tblPrimaryOperationDetails]![DateOfSurgery],[tblPrimaryTumourDetails]![DateDetected])

I guess the fields explain themselves here. I want this calculated field to appear on my form- Primary Operation Details which has its source from tblPrimaryOperationDetails

Cheers
 
Last edited:

RainLover

VIP From a land downunder
Local time
Tomorrow, 04:17
Joined
Jan 5, 2009
Messages
5,041
Access does not know which Record to look at.

Question. Is there a Relationship between these two Tables. Could they be joined and displayed in a Query.
 

Sana210

New member
Local time
Today, 11:17
Joined
Jul 16, 2013
Messages
5
Yes the tables are related. Yes they can be joined and displayed in a query.
I have tried to create an expression suggesting that it should look for date of surgery from the table- primary operation details and date of diagnosis from the table- primary tumour details.
I have to do similar calculations for a number of other fields in this database. Any suggestion would be helpful.
Thank you for your advice:)


P.S. Are you suggesting that I develop a query and then use that as the control source for this text box?
 

RainLover

VIP From a land downunder
Local time
Tomorrow, 04:17
Joined
Jan 5, 2009
Messages
5,041
P.S. Are you suggesting that I develop a query and then use that as the control source for this text box?

That is exactly what I was thinking.

Can you write the expression. Access help will show you, or post back with the best you can do.
 

Sana210

New member
Local time
Today, 11:17
Joined
Jul 16, 2013
Messages
5
That is exactly what I was thinking.

Can you write the expression. Access help will show you, or post back with the best you can do.

Sorry for the delayed response.
Thank you for your suggestion. It worked.
 

RainLover

VIP From a land downunder
Local time
Tomorrow, 04:17
Joined
Jan 5, 2009
Messages
5,041
Good to hear.

Some free advice. Use Access help more often. It really is a good teacher not like the original when we used to say that help is no help at all.

When you look for one thing you often stumble on something else of interest.

Best wishes for the project.
 

Users who are viewing this thread

Top Bottom