Populate New Record with Previous Fields

G

Guest

I have a main form which stores client information to Table1. This main form
has a
subform which stores records for that client in Table2.
When I add a new record for a specific "Client" I want to pull previous
field values for specific fields stored in Table2 for that client.

I've tried this code when used in the AfterUpdate Event but it will pull the
last entries to Table2 without regard to the Client.

Me![My Field].DefaultValue = """" & Me![My Field] & """"

Can anyone help please?
 
J

Jeff Boyce

Before getting to "how", "why?"

Can you be more specific about what kind of information you are keeping in
one record that you feel needs to be (also) kept in another record?

I ask, not out of curiosity, but because it may NOT be necessary to store
the same data twice (or more), but I don't understand what you are trying to
accomplish by doing this...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
G

Guest

I have the main form set up to allow the user to enter patient information
(Demographics) and store it in table1 and a subform that allows them to
schedule appointments and record results/make comments relevent to that
appointment and store them in table2. When looking at the main form you can
view the patients demographic information and view the appointments in the
subform. (The tables are related by the Medical Record Number field). There
are some fields on the subform which most often will remain the same but
change from time to time and to avoid entering it again each time, I was
hoping I could default those field values to those of the previous
appointment "for that patient" while allowing changes if necessary. Thanks
for your response!

--
If you can read this, thank a Teacher...
If your reading it in english, thank a Veteran!


Jeff Boyce said:
Before getting to "how", "why?"

Can you be more specific about what kind of information you are keeping in
one record that you feel needs to be (also) kept in another record?

I ask, not out of curiosity, but because it may NOT be necessary to store
the same data twice (or more), but I don't understand what you are trying to
accomplish by doing this...

Regards

Jeff Boyce
Microsoft Office/Access MVP

Telobamipada said:
I have a main form which stores client information to Table1. This main
form
has a
subform which stores records for that client in Table2.
When I add a new record for a specific "Client" I want to pull previous
field values for specific fields stored in Table2 for that client.

I've tried this code when used in the AfterUpdate Event but it will pull
the
last entries to Table2 without regard to the Client.

Me![My Field].DefaultValue = """" & Me![My Field] & """"

Can anyone help please?
 
J

Jeff Boyce

I was actually asking for specifics.

What is it about the patient (or about the appointments) that you feel you
need to redundantly store in each appointment record?

Regards

Jeff Boyce
Microsoft Office/Access MVP

Telobamipada said:
I have the main form set up to allow the user to enter patient information
(Demographics) and store it in table1 and a subform that allows them to
schedule appointments and record results/make comments relevent to that
appointment and store them in table2. When looking at the main form you
can
view the patients demographic information and view the appointments in the
subform. (The tables are related by the Medical Record Number field).
There
are some fields on the subform which most often will remain the same but
change from time to time and to avoid entering it again each time, I was
hoping I could default those field values to those of the previous
appointment "for that patient" while allowing changes if necessary. Thanks
for your response!

--
If you can read this, thank a Teacher...
If your reading it in english, thank a Veteran!


Jeff Boyce said:
Before getting to "how", "why?"

Can you be more specific about what kind of information you are keeping
in
one record that you feel needs to be (also) kept in another record?

I ask, not out of curiosity, but because it may NOT be necessary to store
the same data twice (or more), but I don't understand what you are trying
to
accomplish by doing this...

Regards

Jeff Boyce
Microsoft Office/Access MVP

Telobamipada said:
I have a main form which stores client information to Table1. This main
form
has a
subform which stores records for that client in Table2.
When I add a new record for a specific "Client" I want to pull previous
field values for specific fields stored in Table2 for that client.

I've tried this code when used in the AfterUpdate Event but it will
pull
the
last entries to Table2 without regard to the Client.

Me![My Field].DefaultValue = """" & Me![My Field] & """"

Can anyone help please?
 
G

Guest

The user has a requirement to view and report on the appointment history.
Appointments are made for different dates and times, ordered by different
doctors, and have different outcomes/results. In most cases the ordering
physician ,family physician, height and weight remain unchanged but it is
recorded during each appointment. For example, they look at weight averages
and perform counts on the physicians (which will be different from time to
time) during various time periods. Beacuse they will most often be the same,
the user would like for the previous visit info for those fields to populate
into the new record when added. I hope this explanation is clear enough for
you.

--
If you can read this, thank a Teacher...
If your reading it in english, thank a Veteran!


Jeff Boyce said:
I was actually asking for specifics.

What is it about the patient (or about the appointments) that you feel you
need to redundantly store in each appointment record?

Regards

Jeff Boyce
Microsoft Office/Access MVP

Telobamipada said:
I have the main form set up to allow the user to enter patient information
(Demographics) and store it in table1 and a subform that allows them to
schedule appointments and record results/make comments relevent to that
appointment and store them in table2. When looking at the main form you
can
view the patients demographic information and view the appointments in the
subform. (The tables are related by the Medical Record Number field).
There
are some fields on the subform which most often will remain the same but
change from time to time and to avoid entering it again each time, I was
hoping I could default those field values to those of the previous
appointment "for that patient" while allowing changes if necessary. Thanks
for your response!

--
If you can read this, thank a Teacher...
If your reading it in english, thank a Veteran!


Jeff Boyce said:
Before getting to "how", "why?"

Can you be more specific about what kind of information you are keeping
in
one record that you feel needs to be (also) kept in another record?

I ask, not out of curiosity, but because it may NOT be necessary to store
the same data twice (or more), but I don't understand what you are trying
to
accomplish by doing this...

Regards

Jeff Boyce
Microsoft Office/Access MVP

I have a main form which stores client information to Table1. This main
form
has a
subform which stores records for that client in Table2.
When I add a new record for a specific "Client" I want to pull previous
field values for specific fields stored in Table2 for that client.

I've tried this code when used in the AfterUpdate Event but it will
pull
the
last entries to Table2 without regard to the Client.

Me![My Field].DefaultValue = """" & Me![My Field] & """"

Can anyone help please?
 
G

Guest

Personally, I'd simply push the values into a few Public variables, then use
the values as necessary. Pedantic, but quite effective.

Telobamipada said:
The user has a requirement to view and report on the appointment history.
Appointments are made for different dates and times, ordered by different
doctors, and have different outcomes/results. In most cases the ordering
physician ,family physician, height and weight remain unchanged but it is
recorded during each appointment. For example, they look at weight averages
and perform counts on the physicians (which will be different from time to
time) during various time periods. Beacuse they will most often be the same,
the user would like for the previous visit info for those fields to populate
into the new record when added. I hope this explanation is clear enough for
you.

--
If you can read this, thank a Teacher...
If your reading it in english, thank a Veteran!


Jeff Boyce said:
I was actually asking for specifics.

What is it about the patient (or about the appointments) that you feel you
need to redundantly store in each appointment record?

Regards

Jeff Boyce
Microsoft Office/Access MVP

Telobamipada said:
I have the main form set up to allow the user to enter patient information
(Demographics) and store it in table1 and a subform that allows them to
schedule appointments and record results/make comments relevent to that
appointment and store them in table2. When looking at the main form you
can
view the patients demographic information and view the appointments in the
subform. (The tables are related by the Medical Record Number field).
There
are some fields on the subform which most often will remain the same but
change from time to time and to avoid entering it again each time, I was
hoping I could default those field values to those of the previous
appointment "for that patient" while allowing changes if necessary. Thanks
for your response!

--
If you can read this, thank a Teacher...
If your reading it in english, thank a Veteran!


:

Before getting to "how", "why?"

Can you be more specific about what kind of information you are keeping
in
one record that you feel needs to be (also) kept in another record?

I ask, not out of curiosity, but because it may NOT be necessary to store
the same data twice (or more), but I don't understand what you are trying
to
accomplish by doing this...

Regards

Jeff Boyce
Microsoft Office/Access MVP

I have a main form which stores client information to Table1. This main
form
has a
subform which stores records for that client in Table2.
When I add a new record for a specific "Client" I want to pull previous
field values for specific fields stored in Table2 for that client.

I've tried this code when used in the AfterUpdate Event but it will
pull
the
last entries to Table2 without regard to the Client.

Me![My Field].DefaultValue = """" & Me![My Field] & """"

Can anyone help please?
 
J

Jeff Boyce

So if a patient has a family physician, why would you need to record that
same fact for each appointment? Are you keeping a history of family
physician, or do you want to know "current" family physician? If the
latter, don't store it redundantly in the appointment record.

I'm pretty sure my weight is different at each appointment, so I can see
wanting to record that each time, but "remain unchanged?!" ... not likely!
And I understand that I "shrink" as I age, so my height is likely to be
changing, too.

If you still need to "pre-load" some/all values in a new appointment record,
one approach would be to add in code that looks up the most recent
appointment record for that patient and sets the values of the controls to
the values in that most recent appointment record.

Or give a try to what Dennis has suggested...

Regards

Jeff Boyce
Microsoft Office/Access MVP

Telobamipada said:
The user has a requirement to view and report on the appointment history.
Appointments are made for different dates and times, ordered by different
doctors, and have different outcomes/results. In most cases the ordering
physician ,family physician, height and weight remain unchanged but it is
recorded during each appointment. For example, they look at weight
averages
and perform counts on the physicians (which will be different from time to
time) during various time periods. Beacuse they will most often be the
same,
the user would like for the previous visit info for those fields to
populate
into the new record when added. I hope this explanation is clear enough
for
you.

--
If you can read this, thank a Teacher...
If your reading it in english, thank a Veteran!


Jeff Boyce said:
I was actually asking for specifics.

What is it about the patient (or about the appointments) that you feel
you
need to redundantly store in each appointment record?

Regards

Jeff Boyce
Microsoft Office/Access MVP

Telobamipada said:
I have the main form set up to allow the user to enter patient
information
(Demographics) and store it in table1 and a subform that allows them to
schedule appointments and record results/make comments relevent to that
appointment and store them in table2. When looking at the main form you
can
view the patients demographic information and view the appointments in
the
subform. (The tables are related by the Medical Record Number field).
There
are some fields on the subform which most often will remain the same
but
change from time to time and to avoid entering it again each time, I
was
hoping I could default those field values to those of the previous
appointment "for that patient" while allowing changes if necessary.
Thanks
for your response!

--
If you can read this, thank a Teacher...
If your reading it in english, thank a Veteran!


:

Before getting to "how", "why?"

Can you be more specific about what kind of information you are
keeping
in
one record that you feel needs to be (also) kept in another record?

I ask, not out of curiosity, but because it may NOT be necessary to
store
the same data twice (or more), but I don't understand what you are
trying
to
accomplish by doing this...

Regards

Jeff Boyce
Microsoft Office/Access MVP

message
I have a main form which stores client information to Table1. This
main
form
has a
subform which stores records for that client in Table2.
When I add a new record for a specific "Client" I want to pull
previous
field values for specific fields stored in Table2 for that client.

I've tried this code when used in the AfterUpdate Event but it will
pull
the
last entries to Table2 without regard to the Client.

Me![My Field].DefaultValue = """" & Me![My Field] & """"

Can anyone help please?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top