please help with calculated unbound control on form

  • Thread starter Thread starter ferde
  • Start date Start date
F

ferde

I have a form called PatientForm with a subform called MedForm . The subform
has a column for data entry called...... DateTime_Antibiotic_Given. Is
there a way to build an unbound calculated control on the main form that
would look at all of the the subform date and times and capture the earliest
dateTime entered in the subform. I need to identify the very first date/time
an antibiotic is administered. I am using Access 2003 and really enjoying
learning and appreciate all the help I have recieved in this group.... I
have the access 2003 Bible if you can point me in the right direction. Thank
you in advance

an example of the dateTime format I am using is 10/28/08 16:35
 
try adding an unbound textbox control to the *subform's* Footer section and
call it txtMin. you can do this even if the subform is set up for Datasheet
view; the section won't show when the form is open, but the control in it
will still be "seen" by Access. if the subform is in Single or Continuous
forms view, you can set the control's Visible propety to False; again, it
will still be "seen" by Access. in the textbox control in the subform Footer
section, set the ControlSource property to

=Min([DateTime_Antibiotic_Given])

in the mainform, set that unbound textbox control's ControlSource property
to

=[SubformControlName].[Form]![txtMin]

replace SubformControlName with the *name of the subform control within the
mainform*.

hth
 
Thank you Tina ,it works beautifully. I thought I would be able to get the
calculated result from my subform to my report but what I've tried hasnt
worked . I get a #Name? error. I am in my report , design view and have an
unbound text control. I've selected the following;
properties
control source
expression builder
forms
Meds Subforms
Date_ABX_Given
= Forms![meds Subform]![Date_ABX_Given]

I was so excited to get the answer to this question from you that I
hadnt looked ahead to see how I would get my subform data to my report.
This is all new but exciting because I'm making progress.

Thanks for your help
Deb

Thank you again
Deb



tina said:
try adding an unbound textbox control to the *subform's* Footer section and
call it txtMin. you can do this even if the subform is set up for Datasheet
view; the section won't show when the form is open, but the control in it
will still be "seen" by Access. if the subform is in Single or Continuous
forms view, you can set the control's Visible propety to False; again, it
will still be "seen" by Access. in the textbox control in the subform Footer
section, set the ControlSource property to

=Min([DateTime_Antibiotic_Given])

in the mainform, set that unbound textbox control's ControlSource property
to

=[SubformControlName].[Form]![txtMin]

replace SubformControlName with the *name of the subform control within the
mainform*.

hth


ferde said:
I have a form called PatientForm with a subform called MedForm . The subform
has a column for data entry called...... DateTime_Antibiotic_Given. Is
there a way to build an unbound calculated control on the main form that
would look at all of the the subform date and times and capture the earliest
dateTime entered in the subform. I need to identify the very first date/time
an antibiotic is administered. I am using Access 2003 and really enjoying
learning and appreciate all the help I have recieved in this group.... I
have the access 2003 Bible if you can point me in the right direction. Thank
you in advance

an example of the dateTime format I am using is 10/28/08 16:35
 
well, to do it the way you're doing it, 1) the form has to remain open while
the report opens (either to preview or print), and 2) you have to refer to
the control in the subform with *basically* the same syntax that you used in
the unbound textbox control in the mainform, just adding the name of the
mainform to the reference, as

=[Forms]![MainformName]![SubformControlName].[Form]![txtMin]

hth


ferde said:
Thank you Tina ,it works beautifully. I thought I would be able to get the
calculated result from my subform to my report but what I've tried hasnt
worked . I get a #Name? error. I am in my report , design view and have an
unbound text control. I've selected the following;
properties
control source
expression builder
forms
Meds Subforms
Date_ABX_Given
= Forms![meds Subform]![Date_ABX_Given]

I was so excited to get the answer to this question from you that I
hadnt looked ahead to see how I would get my subform data to my report.
This is all new but exciting because I'm making progress.

Thanks for your help
Deb

Thank you again
Deb



tina said:
try adding an unbound textbox control to the *subform's* Footer section and
call it txtMin. you can do this even if the subform is set up for Datasheet
view; the section won't show when the form is open, but the control in it
will still be "seen" by Access. if the subform is in Single or Continuous
forms view, you can set the control's Visible propety to False; again, it
will still be "seen" by Access. in the textbox control in the subform Footer
section, set the ControlSource property to

=Min([DateTime_Antibiotic_Given])

in the mainform, set that unbound textbox control's ControlSource property
to

=[SubformControlName].[Form]![txtMin]

replace SubformControlName with the *name of the subform control within the
mainform*.

hth


ferde said:
I have a form called PatientForm with a subform called MedForm . The subform
has a column for data entry called...... DateTime_Antibiotic_Given. Is
there a way to build an unbound calculated control on the main form that
would look at all of the the subform date and times and capture the earliest
dateTime entered in the subform. I need to identify the very first date/time
an antibiotic is administered. I am using Access 2003 and really enjoying
learning and appreciate all the help I have recieved in this group.... I
have the access 2003 Bible if you can point me in the right direction. Thank
you in advance

an example of the dateTime format I am using is 10/28/08 16:35
 
Works great Tina.... Thank you again

tina said:
well, to do it the way you're doing it, 1) the form has to remain open while
the report opens (either to preview or print), and 2) you have to refer to
the control in the subform with *basically* the same syntax that you used in
the unbound textbox control in the mainform, just adding the name of the
mainform to the reference, as

=[Forms]![MainformName]![SubformControlName].[Form]![txtMin]

hth


ferde said:
Thank you Tina ,it works beautifully. I thought I would be able to get the
calculated result from my subform to my report but what I've tried hasnt
worked . I get a #Name? error. I am in my report , design view and have an
unbound text control. I've selected the following;
properties
control source
expression builder
forms
Meds Subforms
Date_ABX_Given
= Forms![meds Subform]![Date_ABX_Given]

I was so excited to get the answer to this question from you that I
hadnt looked ahead to see how I would get my subform data to my report.
This is all new but exciting because I'm making progress.

Thanks for your help
Deb

Thank you again
Deb



tina said:
try adding an unbound textbox control to the *subform's* Footer section and
call it txtMin. you can do this even if the subform is set up for Datasheet
view; the section won't show when the form is open, but the control in it
will still be "seen" by Access. if the subform is in Single or Continuous
forms view, you can set the control's Visible propety to False; again, it
will still be "seen" by Access. in the textbox control in the subform Footer
section, set the ControlSource property to

=Min([DateTime_Antibiotic_Given])

in the mainform, set that unbound textbox control's ControlSource property
to

=[SubformControlName].[Form]![txtMin]

replace SubformControlName with the *name of the subform control within the
mainform*.

hth


I have a form called PatientForm with a subform called MedForm . The
subform
has a column for data entry called...... DateTime_Antibiotic_Given. Is
there a way to build an unbound calculated control on the main form that
would look at all of the the subform date and times and capture the
earliest
dateTime entered in the subform. I need to identify the very first
date/time
an antibiotic is administered. I am using Access 2003 and really enjoying
learning and appreciate all the help I have recieved in this group.... I
have the access 2003 Bible if you can point me in the right direction.
Thank
you in advance

an example of the dateTime format I am using is 10/28/08 16:35
 
you're welcome :)


ferde said:
Works great Tina.... Thank you again

tina said:
well, to do it the way you're doing it, 1) the form has to remain open while
the report opens (either to preview or print), and 2) you have to refer to
the control in the subform with *basically* the same syntax that you used in
the unbound textbox control in the mainform, just adding the name of the
mainform to the reference, as

=[Forms]![MainformName]![SubformControlName].[Form]![txtMin]

hth


ferde said:
Thank you Tina ,it works beautifully. I thought I would be able to
get
the
calculated result from my subform to my report but what I've tried hasnt
worked . I get a #Name? error. I am in my report , design view and
have
an
unbound text control. I've selected the following;
properties
control source
expression builder
forms
Meds Subforms
Date_ABX_Given
= Forms![meds Subform]![Date_ABX_Given]

I was so excited to get the answer to this question from you that I
hadnt looked ahead to see how I would get my subform data to my report.
This is all new but exciting because I'm making progress.

Thanks for your help
Deb

Thank you again
Deb
 
Back
Top