J
juicegully
Hi,
I've been stuck on this problem the whole day and haven't found anything in
the newsgroups to help (maybe i'm looking in the wrong section?!). Anyway,
here goes:
I've created a form whose default view is "continuous forms" becuase I want
the nice (I can add pictures, etc) look of a form (rather than a datasheet)
but be able to view all records for a patient. On the form are text boxes
whose control sources are Date1 and Date2, respectively. For each record I
want to display the number of years, months, and days between Date2 and Date1
of the first record (ie. Date2 - (Date1 of first record)).
Originally, when my forms were still in Single Form view, in the After
Update event of txtDate2, I would calculate the number of years, months, and
days between the two dates and display them in textboxes (and not labels b/c
at times I would disable the text boxes). Now in Continuous Forms view, in
each txtYrs, txtMos, and txtDays is the correct number for the record the
focus is on. E.g. If I'm looking at all of my 5 records, all the txtYrs show
the same number, all the txtMos show the same number, and all the txtDays
show the same number. I really hope this makes sense!! What I want is the
txtYrs,Mos,Days in the first record to display the time difference for the
first record, the txtYrs,Mos,Days in the second record to display the time
difference for the second record , and so on.
It was suggested to me to "Calculate this in the query...then it will show
for all records" but I don't know how to calculate the difference in days in
the query! I was thinking of just creating a new field containing this
difference (to be calculate after txtDate2 has a value). Even if I do have a
new field called "Diff" in my table, I don't know how to display the years,
months, and days for each record unless I create 3 more fields in my table -
Yrs, Mos, and Days. I don't understand how to "calculate this in the query".
I'm not sure if this is the correct discussion group for this question, but
if anyone has any ideas they can share, I'd be VERY grateful.
Thank you!
I've been stuck on this problem the whole day and haven't found anything in
the newsgroups to help (maybe i'm looking in the wrong section?!). Anyway,
here goes:
I've created a form whose default view is "continuous forms" becuase I want
the nice (I can add pictures, etc) look of a form (rather than a datasheet)
but be able to view all records for a patient. On the form are text boxes
whose control sources are Date1 and Date2, respectively. For each record I
want to display the number of years, months, and days between Date2 and Date1
of the first record (ie. Date2 - (Date1 of first record)).
Originally, when my forms were still in Single Form view, in the After
Update event of txtDate2, I would calculate the number of years, months, and
days between the two dates and display them in textboxes (and not labels b/c
at times I would disable the text boxes). Now in Continuous Forms view, in
each txtYrs, txtMos, and txtDays is the correct number for the record the
focus is on. E.g. If I'm looking at all of my 5 records, all the txtYrs show
the same number, all the txtMos show the same number, and all the txtDays
show the same number. I really hope this makes sense!! What I want is the
txtYrs,Mos,Days in the first record to display the time difference for the
first record, the txtYrs,Mos,Days in the second record to display the time
difference for the second record , and so on.
It was suggested to me to "Calculate this in the query...then it will show
for all records" but I don't know how to calculate the difference in days in
the query! I was thinking of just creating a new field containing this
difference (to be calculate after txtDate2 has a value). Even if I do have a
new field called "Diff" in my table, I don't know how to display the years,
months, and days for each record unless I create 3 more fields in my table -
Yrs, Mos, and Days. I don't understand how to "calculate this in the query".
I'm not sure if this is the correct discussion group for this question, but
if anyone has any ideas they can share, I'd be VERY grateful.
Thank you!