Avatar of SteveL13
SteveL13
Flag for United States of America asked on

How have field on a form auto-populate with a data field from another form

I have a form that can be opened via a command button from four other forms.  When the 2nd form opens I want a date field to automatically populate from a date field that is in the 1st form.

But since this date field on the 2nd form can be opened from any one of 4 forms, I am not sure how to populate the date field,  Somehow the 2nd form has to know which of the 4 forms is open and use the date field from that form.

????

--Steve
Microsoft Access

Avatar of undefined
Last Comment
Helen Feddema

8/22/2022 - Mon
PatHartman

There are several solutions.  Here's two.

1. Before opening the pop up form, store the date in a memory variable.  That way the pop up form gets the date from a memory variable and doesn't care what form put it there.
2. Use the open args argument of the OpenForm Method to pass in the date.
ASKER CERTIFIED SOLUTION
Helen Feddema

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy