Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / June 2007

Tip: Looking for answers? Try searching our database.

Populate New Record with Previous Fields

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Telobamipada - 28 Jun 2007 17:34 GMT
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?

Signature

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

Jeff Boyce - 28 Jun 2007 17:50 GMT
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
[quoted text clipped - 10 lines]
>
> Can anyone help please?
Telobamipada - 28 Jun 2007 18:16 GMT
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!

Signature

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

> Before getting to "how", "why?"
>
[quoted text clipped - 24 lines]
> >
> > Can anyone help please?
Jeff Boyce - 28 Jun 2007 19:50 GMT
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

>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
[quoted text clipped - 41 lines]
>> >
>> > Can anyone help please?
Telobamipada - 28 Jun 2007 20:28 GMT
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.

Signature

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

> I was actually asking for specifics.
>
[quoted text clipped - 51 lines]
> >> >
> >> > Can anyone help please?
Dennis - 28 Jun 2007 20:32 GMT
Personally, I'd simply push the values into a few Public variables, then use
the values as necessary. Pedantic, but quite effective.

> The user has a requirement to view and report on the appointment history.
> Appointments are made for different dates and times, ordered by different
[quoted text clipped - 62 lines]
> > >> >
> > >> > Can anyone help please?
Jeff Boyce - 29 Jun 2007 19:32 GMT
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

> The user has a requirement to view and report on the appointment history.
> Appointments are made for different dates and times, ordered by different
[quoted text clipped - 77 lines]
>> >> >
>> >> > Can anyone help please?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.