What am I saving?

Derek Brown
Derek Brown used Ask the Experts™
on
I have a Pop Up Form that has no control source. The form is opened from a command button on the main form. If in the Pop Up form I use:

If Me.Dirty = True Then
    DoCmd.RunCommand acCmdSaveRecord
End If

Am I saving anything?  If not how do I save the main form when code from the Pop Up form Changes data in the main form?

What happens if I don't deliberately save data in either form?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
John TsioumprisSoftware & Systems Engineer

Commented:
Everything that is unbound...is gone...the others should be "saved" just fine
Most Valuable Expert 2015
Distinguished Expert 2018

Commented:
how do I save the main form when code from the Pop Up form Changes data in the main form?

That is done by saving the record in the main form.
So, you could have code in the UnLoad event of the popup form like this:

If Forms!YourMainForm.Dirty = True Then
    Forms!YourMainForm.Dirty = False
End If

Open in new window

Author

Commented:
That's a great help.

It would be nice however if the form could be used for multiple uses. Same procedure. But I just cannot get the Pop Up forms Combobox to update. I now know that the main form is updating but for the life of me I cannot get the popup combo to keep up!!!.

It's driving me Nuts
Most Valuable Expert 2015
Distinguished Expert 2018
Commented:
For simultaneous users you may have to rethink this concept.
John TsioumprisSoftware & Systems Engineer

Commented:
Can you give some sample on what you are trying to do..
If Unbound is the name of the game the simply just throw either a SQL INSERT command or the usual rst/ AddNew/. Update

Author

Commented:
I was trying to get a date between 04/12/2019 and 05/12/2019

I saw all dates as 05/12/2019 but did not notice the change to AM from PM (05/12/2019 12.00 AM)

There's none as blind as those that can see!

My thanks to you both

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial