Opening Pop-Up Form From Sub-Form

adams.bria

Registered User.
Local time
Today, 12:46
Joined
Apr 28, 2010
Messages
41
So the structure essentially is view only form from tbl_data.
Then a subform to set the characteristics of that entry referencing tbl_chars

The characteristics are all yes/no except one, which is a memo. The memo is triggered if yes is answered as one of the chars. How I want it work is a pop-up form that the user enters the memo in, and then closes.

Any advice on how I should do it? My issue is getting the pop-up to filter to the active record. I have tried a couple of things, and what always happens is if I type "example explain memo" in the box, then go to the next record and open the pop-up, the same text appears and it deletes it from the old record and stores it under the new record.

Thanks
 
So that gets the pop-up to load. However, now after I close the pop-up and try to move to a new record I get an error saying the record has changed, would I like to save, or copy the changes. I hit save, and it is not storing the data I entered in the pop-up. I am thinking my pop-up settings are probably the issue, but don't know where to start. Attached is a pic of the settings
 

Attachments

  • Capture.JPG
    Capture.JPG
    77.2 KB · Views: 96
I doubt it's the settings. You've got 2 forms bound to the same record open, which can cause that error. I'd force a save of the record in the code right before opening the pop up:

If Me.Dirty Then Me.Dirty = False
 
I doubt it's the settings. You've got 2 forms bound to the same record open, which can cause that error. I'd force a save of the record in the code right before opening the pop up:

If Me.Dirty Then Me.Dirty = False
Out of interest would that actually SAVE the record, would have thought it would just trick the error away. do you not need a "DoCMD.SaveRecord..." line to actually save? I don't know either way but I'm always keen to save on an extra line of code. Thanks.
 
Yes, either method will actually save the record. It does not just trick the error away (I don't think you can trick that error away, as it's coming from the database engine). The "Dirty" method only saves the record it if it's dirty (has unsaved values), the "DoCmd" method will save it whether it's dirty or not, which some consider wasteful. I have no real preference.
 
Brilliant, that'll save on a a few extra button taps here and there. Thanks again!
 

Users who are viewing this thread

Back
Top Bottom