473,386 Members | 1,598 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Form: Auto fill by previous row?

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

Nov 13 '05 #1
7 1491
> 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.

Nov 13 '05 #2
I had this idea, but I thought there might be a simpler solution.

How would I "point the query at the form"??

Nov 13 '05 #3
SELECT ....
FROM ....
WHERE IdentifierField=[Forms]![MyFormName]![MyControlName]

and make sure the form is open when you run it....

Nov 13 '05 #4
You could do it by hand with "CTRL-'" (That's control and apostrophe)
- which copies the data from the row above...

Steve

Gordo wrote:
I had this idea, but I thought there might be a simpler solution.

How would I "point the query at the form"??

Nov 13 '05 #5
SELECT ....
FROM ....
WHERE IdentifierField=[Forms]![MyFormName]![MyControlName]

and make sure the form is open when you run it....

Nov 13 '05 #6
You could do it by hand with "CTRL-'" (That's control and apostrophe)
- which copies the data from the row above...

Steve

Gordo wrote:
I had this idea, but I thought there might be a simpler solution.

How would I "point the query at the form"??

Nov 13 '05 #7
Excellent... thanks so much!

Nov 13 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Dave B | last post by:
Does anyone know of a program that will read a text file and fill in a web form with the contents of that file? We need to get about 3000 records (5 fields to each record) into a database owned by...
4
by: mitch-co2 | last post by:
What I am trying to do is when someone clicks on the YES radio button I want the text field called MYTEXT to equal the text field named DATE. The below code works as long as I do NOT UN-COMMENT...
3
by: Andy | last post by:
I need your help to check if my autoresponder will work in the following script. I am testing my PHP scripts on free server, which dosen't allow me to send email letters from my website. Please...
5
by: Navillus | last post by:
Hey gang, I have a login form that is empty by default, but can be filled with values from a previous form: <input type=text maxlength="40" size="40" name="user" value="`usr`"> <input...
4
by: battle.chris | last post by:
Hello. I'm trying to fill form fields with values from a mysql record using php. The problem is that when I move to a new record, the form still displays the old data! The html source is updated...
3
by: jacklindsay | last post by:
Hello smarter people than me I am creating a database for college, and have requested some help, but they are unable to help me. ( im obviously too eager) anyway, im creating a database on...
0
DressageRider
by: DressageRider | last post by:
I need your help. Desperately. Someone has to be able to fix the utter balls up I've made after dinking around in Flash for the last four days. I have no prior knowledge of anything other than...
3
by: Steve67 | last post by:
I didn't see a search feature in these forums, so I couldn't look up this question and I am sure it is a common questions. I am trying to auto fill some information on an form. Here is what I have...
1
by: jeddiki | last post by:
Hello, I have made a nice opt-in form and tested it in Moz FF and it looks fine. But in IE the elements don't line up properly. I think I am nearly there but can not get these elements...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.