automatization with form

ReginaF

Registered User.
Local time
Today, 15:06
Joined
Sep 23, 2019
Messages
26
Hello,

I am quite new to Access and certainly to VBA. Despite of that I have quite ambitious plans on the automatization of my DB.

I created a form to add new records to my tables, and to edit existing data. My goal now, would be to automatize the ‘fill out’ of one or two records.
The two tables I am now working with are linked, they have a one to many relationship, through the primary key of my tblMain.

What I would like to do, but currently lack the knowledge and experience in VBA coding is: Every time I add a new or update an existing record of my subform, I would like Access to Loop through all data in the subform belonging to the given primary key and with an IF statement decide whether the subtable contains a given data or set of data, and at the end it will update a record in the tblMain if the statement was true.

I have tried to use Form_AfterInsert(), If Me.subfrmControllName.Form.Dirty Then…, but it is not working☹
For the rest of the problem I do not even know how to begin.

I would like to ask for your kind help in this matter
 
Perhaps you should consider using a main form with a subform.
 
You probably do not need to loop. You likely can use a dcount with a criteria to see if the data exists
 

Users who are viewing this thread

Back
Top Bottom