move data in one form to another after calculation


G

Guest

OK, this is what I have.
I have a main form that I put patient info into. On that form I have a
button that brings up a 2nd form for weight conversion.
The 2nd form consists of 2 fields and a return button to go back to the main
screen.
I have the conversion working, but not the moving of data from the 2nd form
back to the first form.
I have tried adding ' [Forms]![Patient]![BirthWeight] = [Text1] / 2.2046244'
to the afterupdate action on the 2nd form 1st field.
This alas does not work.

TIA
 
Ad

Advertisements

J

Jeff Boyce

I'm not understanding why you need a second form. I'm not clear what you
want to do with the calculated value -- show it on the form, or are you
trying to add a calculated value to a table (this is rarely necessary or a
good idea).

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
G

Guest

Jeff,
When I receive the patient weight it is in lbs. What I have to have is
Kgs. So I added a button to the form to open up a converter form, where the
2nd form has 2 fields.
1st is the lbs field the 2nd is the kgs field which has =text1/2.2,,,,,,,
which there in does the calculation. then I need that converted weight to be
placed into the weght of the man form.
Thank you
/bw

Jeff Boyce said:
I'm not understanding why you need a second form. I'm not clear what you
want to do with the calculated value -- show it on the form, or are you
trying to add a calculated value to a table (this is rarely necessary or a
good idea).

Regards

Jeff Boyce
Microsoft Office/Access MVP

benny wa said:
OK, this is what I have.
I have a main form that I put patient info into. On that form I have a
button that brings up a 2nd form for weight conversion.
The 2nd form consists of 2 fields and a return button to go back to the
main
screen.
I have the conversion working, but not the moving of data from the 2nd
form
back to the first form.
I have tried adding ' [Forms]![Patient]![BirthWeight] = [Text1] /
2.2046244'
to the afterupdate action on the 2nd form 1st field.
This alas does not work.

TIA
 
J

Jeff Boyce

No button, no second form needed.

Add a control on your first form in design view. Set the ControlSource of
that control to something like:

=[YourPoundsControlName]/2.2,,,,,,,

You may also need to add

Me.Repaint

to the form's Current event procedure to get the results of the calculation
displayed. Maybe even to the YourPoundsControlName_AfterUpdate event
procedure too.

Regards

Jeff Boyce
Microsoft Office/Access MVP

benny wa said:
Jeff,
When I receive the patient weight it is in lbs. What I have to have is
Kgs. So I added a button to the form to open up a converter form, where
the
2nd form has 2 fields.
1st is the lbs field the 2nd is the kgs field which has =text1/2.2,,,,,,,
which there in does the calculation. then I need that converted weight to
be
placed into the weght of the man form.
Thank you
/bw

Jeff Boyce said:
I'm not understanding why you need a second form. I'm not clear what you
want to do with the calculated value -- show it on the form, or are you
trying to add a calculated value to a table (this is rarely necessary or
a
good idea).

Regards

Jeff Boyce
Microsoft Office/Access MVP

benny wa said:
OK, this is what I have.
I have a main form that I put patient info into. On that form I have a
button that brings up a 2nd form for weight conversion.
The 2nd form consists of 2 fields and a return button to go back to the
main
screen.
I have the conversion working, but not the moving of data from the 2nd
form
back to the first form.
I have tried adding ' [Forms]![Patient]![BirthWeight] = [Text1] /
2.2046244'
to the afterupdate action on the 2nd form 1st field.
This alas does not work.

TIA
 
G

Guest

I added a unbound control on the main form and then put in the kgs box
=[Text125]/2.2046244.
When I save this record though I dont thik it will save the weight back to
the table since the control source is as listed abouve will it?

Jeff Boyce said:
No button, no second form needed.

Add a control on your first form in design view. Set the ControlSource of
that control to something like:

=[YourPoundsControlName]/2.2,,,,,,,

You may also need to add

Me.Repaint

to the form's Current event procedure to get the results of the calculation
displayed. Maybe even to the YourPoundsControlName_AfterUpdate event
procedure too.

Regards

Jeff Boyce
Microsoft Office/Access MVP

benny wa said:
Jeff,
When I receive the patient weight it is in lbs. What I have to have is
Kgs. So I added a button to the form to open up a converter form, where
the
2nd form has 2 fields.
1st is the lbs field the 2nd is the kgs field which has =text1/2.2,,,,,,,
which there in does the calculation. then I need that converted weight to
be
placed into the weght of the man form.
Thank you
/bw

Jeff Boyce said:
I'm not understanding why you need a second form. I'm not clear what you
want to do with the calculated value -- show it on the form, or are you
trying to add a calculated value to a table (this is rarely necessary or
a
good idea).

Regards

Jeff Boyce
Microsoft Office/Access MVP

OK, this is what I have.
I have a main form that I put patient info into. On that form I have a
button that brings up a 2nd form for weight conversion.
The 2nd form consists of 2 fields and a return button to go back to the
main
screen.
I have the conversion working, but not the moving of data from the 2nd
form
back to the first form.
I have tried adding ' [Forms]![Patient]![BirthWeight] = [Text1] /
2.2046244'
to the afterupdate action on the 2nd form 1st field.
This alas does not work.

TIA
 
J

Jeff Boyce

If your form shows the correctly calculated kg conversion, why do you need
to STORE it, too?

Regards

Jeff Boyce
Microsoft Office/Access MVP

benny wa said:
I added a unbound control on the main form and then put in the kgs box
=[Text125]/2.2046244.
When I save this record though I dont thik it will save the weight back to
the table since the control source is as listed abouve will it?

Jeff Boyce said:
No button, no second form needed.

Add a control on your first form in design view. Set the ControlSource
of
that control to something like:

=[YourPoundsControlName]/2.2,,,,,,,

You may also need to add

Me.Repaint

to the form's Current event procedure to get the results of the
calculation
displayed. Maybe even to the YourPoundsControlName_AfterUpdate event
procedure too.

Regards

Jeff Boyce
Microsoft Office/Access MVP

benny wa said:
Jeff,
When I receive the patient weight it is in lbs. What I have to have is
Kgs. So I added a button to the form to open up a converter form, where
the
2nd form has 2 fields.
1st is the lbs field the 2nd is the kgs field which has
=text1/2.2,,,,,,,
which there in does the calculation. then I need that converted weight
to
be
placed into the weght of the man form.
Thank you
/bw

:

I'm not understanding why you need a second form. I'm not clear what
you
want to do with the calculated value -- show it on the form, or are
you
trying to add a calculated value to a table (this is rarely necessary
or
a
good idea).

Regards

Jeff Boyce
Microsoft Office/Access MVP

OK, this is what I have.
I have a main form that I put patient info into. On that form I have
a
button that brings up a 2nd form for weight conversion.
The 2nd form consists of 2 fields and a return button to go back to
the
main
screen.
I have the conversion working, but not the moving of data from the
2nd
form
back to the first form.
I have tried adding ' [Forms]![Patient]![BirthWeight] = [Text1] /
2.2046244'
to the afterupdate action on the 2nd form 1st field.
This alas does not work.

TIA
 
Ad

Advertisements

P

Pieter Wijnen

no,
but you don't need to store the transformed/calculated data
recalculate any where you want it

Pieter

benny wa said:
I added a unbound control on the main form and then put in the kgs box
=[Text125]/2.2046244.
When I save this record though I dont thik it will save the weight back to
the table since the control source is as listed abouve will it?

Jeff Boyce said:
No button, no second form needed.

Add a control on your first form in design view. Set the ControlSource
of
that control to something like:

=[YourPoundsControlName]/2.2,,,,,,,

You may also need to add

Me.Repaint

to the form's Current event procedure to get the results of the
calculation
displayed. Maybe even to the YourPoundsControlName_AfterUpdate event
procedure too.

Regards

Jeff Boyce
Microsoft Office/Access MVP

benny wa said:
Jeff,
When I receive the patient weight it is in lbs. What I have to have is
Kgs. So I added a button to the form to open up a converter form, where
the
2nd form has 2 fields.
1st is the lbs field the 2nd is the kgs field which has
=text1/2.2,,,,,,,
which there in does the calculation. then I need that converted weight
to
be
placed into the weght of the man form.
Thank you
/bw

:

I'm not understanding why you need a second form. I'm not clear what
you
want to do with the calculated value -- show it on the form, or are
you
trying to add a calculated value to a table (this is rarely necessary
or
a
good idea).

Regards

Jeff Boyce
Microsoft Office/Access MVP

OK, this is what I have.
I have a main form that I put patient info into. On that form I have
a
button that brings up a 2nd form for weight conversion.
The 2nd form consists of 2 fields and a return button to go back to
the
main
screen.
I have the conversion working, but not the moving of data from the
2nd
form
back to the first form.
I have tried adding ' [Forms]![Patient]![BirthWeight] = [Text1] /
2.2046244'
to the afterupdate action on the 2nd form 1st field.
This alas does not work.

TIA
 
G

Guest

The calculated data is what is pulled for reports and to administer patient
Pharmacuticals. And it only comes to us in lbs format.
Could I modify the table to always convert the data that is entered?

Pieter Wijnen said:
no,
but you don't need to store the transformed/calculated data
recalculate any where you want it

Pieter

benny wa said:
I added a unbound control on the main form and then put in the kgs box
=[Text125]/2.2046244.
When I save this record though I dont thik it will save the weight back to
the table since the control source is as listed abouve will it?

Jeff Boyce said:
No button, no second form needed.

Add a control on your first form in design view. Set the ControlSource
of
that control to something like:

=[YourPoundsControlName]/2.2,,,,,,,

You may also need to add

Me.Repaint

to the form's Current event procedure to get the results of the
calculation
displayed. Maybe even to the YourPoundsControlName_AfterUpdate event
procedure too.

Regards

Jeff Boyce
Microsoft Office/Access MVP

Jeff,
When I receive the patient weight it is in lbs. What I have to have is
Kgs. So I added a button to the form to open up a converter form, where
the
2nd form has 2 fields.
1st is the lbs field the 2nd is the kgs field which has
=text1/2.2,,,,,,,
which there in does the calculation. then I need that converted weight
to
be
placed into the weght of the man form.
Thank you
/bw

:

I'm not understanding why you need a second form. I'm not clear what
you
want to do with the calculated value -- show it on the form, or are
you
trying to add a calculated value to a table (this is rarely necessary
or
a
good idea).

Regards

Jeff Boyce
Microsoft Office/Access MVP

OK, this is what I have.
I have a main form that I put patient info into. On that form I have
a
button that brings up a 2nd form for weight conversion.
The 2nd form consists of 2 fields and a return button to go back to
the
main
screen.
I have the conversion working, but not the moving of data from the
2nd
form
back to the first form.
I have tried adding ' [Forms]![Patient]![BirthWeight] = [Text1] /
2.2046244'
to the afterupdate action on the 2nd form 1st field.
This alas does not work.

TIA
 
P

Pieter Wijnen

no,
but you can add the calculation in any query, form or report based on it
if you have a lot the simplest solution is to create a function & invoke
that when you need it
ie
Public Function Lbs2Kg(Byval LBS as Double) As Double
lbs2Kg = LBS/2.2046244
End Function

Pieter

PS isn't it about time you folks drop those archaic meassurements, heck even
the brits are getting used to metrics <g>


benny wa said:
The calculated data is what is pulled for reports and to administer
patient
Pharmacuticals. And it only comes to us in lbs format.
Could I modify the table to always convert the data that is entered?

Pieter Wijnen said:
no,
but you don't need to store the transformed/calculated data
recalculate any where you want it

Pieter

benny wa said:
I added a unbound control on the main form and then put in the kgs box
=[Text125]/2.2046244.
When I save this record though I dont thik it will save the weight back
to
the table since the control source is as listed abouve will it?

:

No button, no second form needed.

Add a control on your first form in design view. Set the
ControlSource
of
that control to something like:

=[YourPoundsControlName]/2.2,,,,,,,

You may also need to add

Me.Repaint

to the form's Current event procedure to get the results of the
calculation
displayed. Maybe even to the YourPoundsControlName_AfterUpdate event
procedure too.

Regards

Jeff Boyce
Microsoft Office/Access MVP

Jeff,
When I receive the patient weight it is in lbs. What I have to have
is
Kgs. So I added a button to the form to open up a converter form,
where
the
2nd form has 2 fields.
1st is the lbs field the 2nd is the kgs field which has
=text1/2.2,,,,,,,
which there in does the calculation. then I need that converted
weight
to
be
placed into the weght of the man form.
Thank you
/bw

:

I'm not understanding why you need a second form. I'm not clear
what
you
want to do with the calculated value -- show it on the form, or are
you
trying to add a calculated value to a table (this is rarely
necessary
or
a
good idea).

Regards

Jeff Boyce
Microsoft Office/Access MVP

OK, this is what I have.
I have a main form that I put patient info into. On that form I
have
a
button that brings up a 2nd form for weight conversion.
The 2nd form consists of 2 fields and a return button to go back
to
the
main
screen.
I have the conversion working, but not the moving of data from
the
2nd
form
back to the first form.
I have tried adding ' [Forms]![Patient]![BirthWeight] = [Text1] /
2.2046244'
to the afterupdate action on the 2nd form 1st field.
This alas does not work.

TIA
 
Ad

Advertisements

J

Jeff Boyce

If you use a query to "calculate", you don't even need to do it in the form.

You can use a query as a source for a form and/or a report.

Again, no need to store the calculated value (and some very good reasons NOT
to).

Regards

Jeff Boyce
Microsoft Office/Access MVP

benny wa said:
The calculated data is what is pulled for reports and to administer
patient
Pharmacuticals. And it only comes to us in lbs format.
Could I modify the table to always convert the data that is entered?

Pieter Wijnen said:
no,
but you don't need to store the transformed/calculated data
recalculate any where you want it

Pieter

benny wa said:
I added a unbound control on the main form and then put in the kgs box
=[Text125]/2.2046244.
When I save this record though I dont thik it will save the weight back
to
the table since the control source is as listed abouve will it?

:

No button, no second form needed.

Add a control on your first form in design view. Set the
ControlSource
of
that control to something like:

=[YourPoundsControlName]/2.2,,,,,,,

You may also need to add

Me.Repaint

to the form's Current event procedure to get the results of the
calculation
displayed. Maybe even to the YourPoundsControlName_AfterUpdate event
procedure too.

Regards

Jeff Boyce
Microsoft Office/Access MVP

Jeff,
When I receive the patient weight it is in lbs. What I have to have
is
Kgs. So I added a button to the form to open up a converter form,
where
the
2nd form has 2 fields.
1st is the lbs field the 2nd is the kgs field which has
=text1/2.2,,,,,,,
which there in does the calculation. then I need that converted
weight
to
be
placed into the weght of the man form.
Thank you
/bw

:

I'm not understanding why you need a second form. I'm not clear
what
you
want to do with the calculated value -- show it on the form, or are
you
trying to add a calculated value to a table (this is rarely
necessary
or
a
good idea).

Regards

Jeff Boyce
Microsoft Office/Access MVP

OK, this is what I have.
I have a main form that I put patient info into. On that form I
have
a
button that brings up a 2nd form for weight conversion.
The 2nd form consists of 2 fields and a return button to go back
to
the
main
screen.
I have the conversion working, but not the moving of data from
the
2nd
form
back to the first form.
I have tried adding ' [Forms]![Patient]![BirthWeight] = [Text1] /
2.2046244'
to the afterupdate action on the 2nd form 1st field.
This alas does not work.

TIA
 

Top