You can't perform that action at this time!! (1 Viewer)

GailFialho

Registered User.
Local time
Today, 06:55
Joined
Nov 20, 2001
Messages
34
Hello Anyone Again!
I guess I'm full of problems this weekend.
As always, thank you in advance to anyone who might have the time to help me out.

First: the tables in question are described under the recent topic "Relationships" 10-13-02 with my name. That problem has been solved, but seems to have crated an even worse one.

At some point in time, I need to move a record from the Watch table to the actual Contracts table. I've accomplished this with a simple append query using the WatchID as criteria followed by
Set rs = db.OpenRecordset("tblContracts")
rs.MoveLast
'Grab the ContractID from the Contract table
Me.ContractID= rs!ContractID
rs.Close
This ID I use to append the WatchHistory records to the ContractHistory table.
Within the code, I then open the Contracts form to the new record. All of this happens quite nicely. At this point, I cannot close the Contracts form. I get the message "You can't perform that action at this time!!". The database locks up and I have to use ctrl+alt+delete.
PLEASE HELP
 

Jack Cowley

Registered User.
Local time
Today, 06:55
Joined
Aug 7, 2000
Messages
2,639
I am really not sure what is happening with your code, but here are a couple of suggestion... Have you stepped through the code to see what is happening at each stage? What happens if you remark out the code that opens the Contract form? Does everything work smoothly then? What happens if you just open the form without moving to a new record? Can you open a different form without a problem?

At this point I do not know what else to suggest...

Jack
 

GailFialho

Registered User.
Local time
Today, 06:55
Joined
Nov 20, 2001
Messages
34
Thank You Again

Yes I have stepped through the code. When I move the record from the Watch to the Contract I leave the Watch form open but not visible and open the Contract form. The close button on the Contract form checks if the Wach form is loaded, if so, makes it visible, then closes the Contract form, thereby enabling the user to return to the Watch form where he/she was working. Only instead of closing, I get the infamous message. I removed all of the code and the close button and just created a command button with access and get the same message. Right now, all I can do is have my user close the watch form, return to the main menu, and open the new Contract record by searching for it in the SearchRecords form. Not the best way to go but all I have right now.
Thanks again for your time and interest.:rolleyes:
 

Jack Cowley

Registered User.
Local time
Today, 06:55
Joined
Aug 7, 2000
Messages
2,639
I am grasping at straws, but have you explicitly referred to the form in the DoCmd.Close line of code? I.e. DoCmd.Close acForm, "frmContracts"? If you haven't tried this then give it a try using the actual name of your Contract form and see what happens...

Jack
 

GailFialho

Registered User.
Local time
Today, 06:55
Joined
Nov 20, 2001
Messages
34
I am now totally befuddled!!!
I commented out all of the code that was giving me the problem, as I have told you, and continued working. Just for the heck of it, I just went and removed the apostrophies and tested the code one more time to track the path and pinpoint exactly where the message was popping up. And it works just fine now! I didn't change anything. I don't get it. I have found Access to be mysterious on occasion.

Again, Thank You
 

Jack Cowley

Registered User.
Local time
Today, 06:55
Joined
Aug 7, 2000
Messages
2,639
Ah, the mysteries of Access! I am glad that things are finally working for you as they are supposed to, at long last!

Continued success with your project!

Jack
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 01:55
Joined
Feb 19, 2002
Messages
43,396
You have a problem that you have not yet discovered.

Last does not return the most recently entered record as most people seem to think, it returns the last record in a recordset which is not the same thing. During testing the last record added to a table and the last record returned in an unsorted recordset will frequently coinside because the table size is usually small and lots of updates have not been done. Since the order of a recordset is indeterminate unless the recordset is specifically sorted by a unique field, it is only by chance that you are retrieving the expected record.

Use DMax() to find the record with the largest value in the autonumber field to find the last record that was entered.
 

Users who are viewing this thread

Top Bottom