Main form freeze after update in subform

Cleave

New Member
Joined
Jun 9, 2011
Messages
5
My main form has a list box where a person (CurrentPersonName ) is selected.

The subform is populated by data from the table record of the selected person using a where statement. (Q = Chr$(34))

Forms!DisplayPersonProperty!PersonData.Form.Filter = _
"PersonByLastFirst.FullName=" _
& Q & CurrentPersonName & Q
Forms!DisplayPersonProperty!PersonData.Form.FilterOn = True


When a field in the subform is updated, while other files in the subform can also be updated, no actions on the main form can. Forexample, the selection of a different person from the list box can't be done.

I need some way to "get back to" the main form.

****
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Not sure I'm following, but it seems if you turned the filter off, then all records would be available for Selecting.
 
Upvote 0
I established a new button on the subform - "done" and in it I put:

Forms!DisplayPersonProperty!PersonData.Form.FilterOn = False 'subform
DoCmd.OpenForm "DisplayPersonProperty", acNormal 'main form

Hoping that would follow your suggestion and get me back to the main form.

Still froze.
 
Upvote 0
Can you post more code on how the two forms interact with each other? And remember to wrap it in code tags i.e [ code], and [/ code] without the space. It's easier read.
 
Upvote 0
What else do you have on the main form apart from the listbox?
 
Upvote 0
I found the root of the problem. On Form after_update for the subform I have
Editor = Environ("username")

Editor is the name of a field in the person table.; the idea is to record who it was that changed the data.

Must do some research into that call.

Thanks for your response...

****
 
Upvote 0
****

Is that also on the subform or included in it's record source?
 
Upvote 0
Each record has such a field, as well as one for the last update date/time which match the fields on the form.

But apparently it isn't just the environment call that causes the problem. Either....

Just dawned on me! I'm setting some fields in the form's after update sub!

I'll change the code so that these items are set when one of the other fields is set. Probably good anyway since I want to log the entry for each field change and that would be a hand place to put these.

Sigh.

****
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,286
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top