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 / General 1 / February 2005

Tip: Looking for answers? Try searching our database.

Form: Auto fill by previous row?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gordo - 21 Feb 2005 18:01 GMT
Hiya,

I am kind of a novice at this and I think there might be a very easy
solution to this that I am missing...

I have a form that we fill out for a patient's medication use.  The
underlying table has the pt id, and visit id and then the meds (type,
dosage, route etc... for up to 8 meds.)  So when the form pops up for a
specific patient there are 8 "pages"/rows with the first being the
first visit... 8 visits total.

On their second visit their med use is almost always the same as the
first visit.  What is an easy way to autofill the second visit med use
with the first visit info?

Thanks,
Gordo
pietlinden@hotmail.com - 21 Feb 2005 19:37 GMT
> On their second visit their med use is almost always the same as the
> first visit.  What is an easy way to autofill the second visit med use
> with the first visit info?
>
> Thanks,
> Gordo

One way would be to get the ID of the first visit and then grab the
child records from it and insert them with the updated visit info
(second visit).  So, create a query that grabs the meds info from the
previous visit.  Turn it into an append query, but with the current
visit's ID. (You should be able to point the query at the form you have
open.)  Then run the query.  Test it out in a dummy database, then when
you're sure it works, do the usual - turn warnings off, run append
query, turn warnings back on, requery subform recordsource etc.
Gordo - 21 Feb 2005 20:39 GMT
I had this idea, but I thought there might be a simpler solution.

How would I "point the query at the form"??
pietlinden@hotmail.com - 22 Feb 2005 02:34 GMT
SELECT ....
FROM ....
WHERE IdentifierField=[Forms]![MyFormName]![MyControlName]

and make sure the form is open when you run it....
Gordo - 22 Feb 2005 18:38 GMT
Excellent... thanks so much!
Steve - 22 Feb 2005 02:48 GMT
You could do it by hand with "CTRL-'"   (That's control and apostrophe)
- which copies the data from the row above...

Steve

> I had this idea, but I thought there might be a simpler solution.
>
> How would I "point the query at the form"??
 
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.