Refresh Form Data

DeanFran

Registered User.
Local time
Today, 13:31
Joined
Jan 10, 2014
Messages
111
Here is the scenario:
Form 1 - Data entry for a new project
Form 2 - Data entry for a task associated with the project in the Form 1

Button on form 1 that opens Form 2.

What I am trying to do:
Use a combobox on Form Two to choose the Project entered into Form 1, so I can capture the Form1 PK as a FK on Form 2.

Here is the problem:

Refreshing the record on the button click so that the new option entered into Form 1 shows up in the combo box on Form 2.

Full disclosure:
I'm not much good at VBA so I have been trying to do this by customizing the button macro. I have tried Refresh, and Requery, but I can't seem to get it to update the list in the combo box.

2 questions:

1. How can I get this accomplished?
2. Is there a better way to get this data into the table than what I am trying to do?
 
Have you considered using Form2 as a subform on your Form1?

Then no code required - in the subform control set the linkchild property to the FK in the subform and the linkmaster to the PK on the main form.
 
Thanks for replying. I hadn't considered the sub form idea. I made a quick demo and it appears to work like a charm. I can use this same basic format making the sub form a continuous form for the existing projects and related existing tasks too. Thank you.
 
subforms are the way it is usually done;)
 

Users who are viewing this thread

Back
Top Bottom