Closing Forms with Sub-Forms

  • Thread starter Thread starter Scott
  • Start date Start date
S

Scott

How do you close a form with a sub form when changes have
been performed using specific record delete and inserts
in VBA code?

I receieve a message stating "The action can't be carried
out when processing a form or report event."

I want to close the form so I can repopulate it with the
updated data. Just so we are clear, the requery function
doesn't work when the form was loaded with a filter
designed to retrieve specific records rather than the
entire table's contents when it was specified by the
prior form that called it to be opened.

Anybody up for the challenge because they have gone
beyond Access's capabilities in their development?
 
How do you close a form with a sub form when changes have
been performed using specific record delete and inserts
in VBA code?

I receieve a message stating "The action can't be carried
out when processing a form or report event."

I want to close the form so I can repopulate it with the
updated data. Just so we are clear, the requery function
doesn't work when the form was loaded with a filter
designed to retrieve specific records rather than the
entire table's contents when it was specified by the
prior form that called it to be opened.

Anybody up for the challenge because they have gone
beyond Access's capabilities in their development?

I don't know a requery wouldn't work. If the filter is the problem
just remove it to a variable, do the requery, add the filter back
using the variable.

Dim strFilter As String

strFilter = Me.Filter
Me.Filter = ""
Me.Requery
Me.Filter = strFilter
Me.FilterOn = True

Closing and reopening the form sounds like an extreme way to deal with
it.

- Jim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top