error: you can't carry out this action at the present time

stormin_norm

Registered User.
Local time
Today, 17:12
Joined
Apr 23, 2003
Messages
213
I have one form->subform which continues to produce the following error message when I attempt to exit the form:
"You can't carry out this action at the present time"

I checked all the forms for locking etc...but can not find what is causing this error message. HELP! What typically causes this error? I have to kill access, delete the ldb file, and then restart access. I have other form/subform combos which work fine. And YES, I have run the compact/repair utility. Any other hints?

background:
A student transcript contains 1..n colleges, for each college there are 1..n courses the student has taken at the college.


psuedo-forms:

frmCollegeCourseSelect - select a student from the STUDENT table, double click method on list box runs following code:
DoCmd.OpenForm "frmCollegeCourse", , , "[StudentID] = " & Me![lbStudentSelection]


frmCollegeCourse record source is the table College

fsubCollegeCourse record source is the table Course linked to parent from [StudentID], [College Number]
 
I tried various backup copies of the database to see when the error popped up. Hunting for what changed.
The only thing I noticed is the selection form frmCollegeCourseSelect stays open and will not close, no error message, but remains open even though I closed the details form w/ subform.

Is there something with the DoCmd.OpenForm causing this? I'll try to open the form in edit mode. Perhaps putting a string in the openform method may kick this thing into working.

storm.
 
Your forms should use queries as their recordsources rather than tables but that's not the problem.

Make sure that you don't have code in the class module that is conflicting with the automatic update process that Access does when you close a form or move to a new record. It sounds like you are attempting something recursive such as trying to save the current record within the BeforeUpdate event.

The ONLY time you ever need to force a record save is if you have a button on the form that is intended to open a report/form/ or query that uses a recordset that should contain the current record. Aside from this, the Access code behind a bound form takes care of saving records at appropriate times in all cases except a power off or other total system failure.
 
No auto update process or recursion in my code. So that is okay.
Just a simple:
Form select student --> DoCmd.openform formWithsubform [studentid]=lbstudentselect

I changed the form and subforms to use a query as the record source vs. the table. And everything appears to be working fine. WHY? I'm not sure why.

I checked Scott Barker's Access 2000 power programming book for the error message, and it is caused by the DoCmd
So I have to conclude using the DoCmd to open a form and subform 'may' cause problems. My other forms with recordsource as a tables work fine. Just this one is a pain the butt. So now I have to create queries for each table vs. point to the table directly.

It makes no sense. But this must be the quirky nature of access. Why can't you use a form directly against a table?? Maybe a JET/Locking issue? maybe with the filter of the docmd?

Thanks for the advice.
stormin' norm.
 
You can use a table as the recordsource for a form. It is simply poor practice. The problem you were having may have occured because the form was corrupted in some way.
 
Thanks for the tips.

I agree with the form corruption. I had a similar parameter form with two queries to populate the list boxes which appeared corrupt. I then renamed it to bad_xxxxxx and rebuilt the form. The form worked fine then. Until the other day.
I then deleted the bad_xxxxx, ran rebuild/compress and still problems. Then I did your suggestion binding the recordsource to query vs. table and all appears to work well.

It could stem from the bad_xxxx form. I guess what I will do is delete the forms and all the queries involved, run compress/rebuild, and then rebuild the forms and queries from scratch.....just to be safe ;-)

From what I read in other threads, it always the form which gets corrupted. I never heard of a query requiring a rebuild. But they are simple to rebuild anyway, so the extra two minutes is not a big deal.

-stormin.
 
I just thought I'd resusitate this old post with my experience of error 2486.

I discovered (curiously) that it only occurred using one particular backend file of the same structure as the others but different data.


Anyway I got the error when opening a form from my menu. The button on the menu had a filter in it so that only specific records appeared on the form.

I dicovered that it was the filter causing problems as the fomr worked fine when opened from the database window.

the line was
Docmd.openform stdocname,,,"[CoID]=[Forms]![Menu]![CoID]"

To solve this I put the filter in the query on the form instead of on the button on the menu.

Hope this might help someone. I noticed alot of the posts involved filters.

If anyone ever finds out why this suddenly starts happenig to dbs that function for years without problems then start playing up, please post. It does worry me, whats next to stuff up.

Rachael
 

Users who are viewing this thread

Back
Top Bottom