form to add two records to table

Wysy

Registered User.
Local time
Today, 15:18
Joined
Jul 5, 2015
Messages
335
Hi, I am asking for your help to solve the following.
I need to add the same data into the subform of the different records.
I have made a form with an unbound control and has a VBA code to autofill it to the suborm like
me.control=me.parent.unbound control.
It works all right. However i need to put two records to the same subform with autofill like process. Is it possible?
thanks
Andrew
 
unbound control = Mike
unbound control2 = Brown
me.control=me.parent.unbound control & " " & me.parent.unbound control2
me.control = Mike Brown
is this what you ask?
 
If I need to add multiple records to a table based on some specific criteria, or containing some known data, I would do so with an expressly written insert query or recordset, rather than using an existing form.

Search for "insert query" or "add records using recordset." This may take some learning to achieve, but it will be more reliable, simpler, faster, clearer, etc...
 
thanks for the inputs! however that did solve my problem. so here is a bit more details. It is database for a vet praxis where every patient has treatments which are in a subform. If i do mass treatments (same treatments for many patients) i will use the unbound control scinario. However it can be that there are two treatments for every patient. The inserting i would like to get automatized.
 
You did not ask a question, and it's not clear to me from you post what you are seeking.
 
sorry for not being clear. So i would like to add the same two records, f.e. treatmentA and treatmentB to the subform of every patient when i do mass treatments. This way i could avoid typing treatmentA and treatmentB as many times as i have patients. I am trying to achieve this by having a form with two unbound controls and use some VBA code to autofill the two subsequent rows of the subform after the update event of the patient.
 
Did you do a search for the topics i mentioned a few posts ago? What did you learn? Where are you stuck?
 
just started, but i did not get it ready yet. I will updated you. With previous mail i have just answered your previous mail i have missed thank you!
 

Users who are viewing this thread

Back
Top Bottom