create a new record in a subform using a button on a form

laghetto

Registered User.
Local time
Today, 14:22
Joined
Aug 20, 2011
Messages
27
i had a form with a button and a subform.
i need that pressing on the button a new record in the subform will be added.
if possible in the data field of subform i'd like to save the data of that event and in another field copy the value of a field of the main form.
if i press again the button it will create a new record with data and copied field.

marry christmas!

al
 
hi!
i'm not sure to have understood.
or that my explanation was ok.
so i post my file.

thanx anyway
 

Attachments

I'm not sure I understand the request. I've looked at the access mbd that you posted but I'm still unclear as to what you are requesting.

Do you just want to add a new record to your subform and insert some data into this new record using the parent record as the source?
 
hi,
i need that clicking on de button, in the main form, a new record will be added in the small one and if possible in the date field of this (always the second) it will saved the date of the event.

bye
 
Where will users input the data that goes into the smaller form? Your subform already has the Add New row at the bottom, if users enter data in there it will create a new record.
 
I have uploaded a new db with some explanations, i hoper i could be useful.


have a nice day
 

Attachments

So you just need to add a record to the subform using a button on the main form?

Make a button and call it say, btnNew then in the On Click event for the button, use the following code as a template:

Code:
    With Me.M_tab_registrazioni.Form.RecordsetClone
         .AddNew
              !data_registrazione = Now()
              !ID_promemoria = Me.ID_promemoria
         .Update
    End With

Try that and let me know if that's is sort of what you are looking for.
 
it works!!!!!!!!!
great great great!
thank you fot your help and patience!
sorry for make you lose time before to post the last file.

i wish you have a wonderful christmas!
 
So you just need to add a record to the subform using a button on the main form?

Make a button and call it say, btnNew then in the On Click event for the button, use the following code as a template:

Code:
    With Me.M_tab_registrazioni.Form.RecordsetClone
         .AddNew
              !data_registrazione = Now()
              !ID_promemoria = Me.ID_promemoria
         .Update
    End With

Try that and let me know if that's is sort of what you are looking for.
Thaks a ton! even after 11 years your still best as no one else could give me precise reply in my question, please find the link.

 

Users who are viewing this thread

Back
Top Bottom