The command 'SaveRecord' Isn't available now

human_anomaly

Registered User.
Local time
Today, 00:47
Joined
Apr 12, 2004
Messages
69
I am having a problem with my forms. They are being used for data entry they have allow edits, allow additions, and data entry all turned on with a recordset type of updateable snapshot. When I try to add an item I getting some error messages. I can't figure out what is causing them, they seem to just pop up randomly. The error messages are "You can't use the GoToRecord Action or method on an object in design view" the second error message is "The command or action 'SaveRecord' isn't available now" The two error messages are never displayed together, it is either one or the other never both. By far the most common one I am seing is the 'SaveRecord' error. I don't know if this matters but the database is a subscriber to an SQL Server, the only reason I think this may have somthing to do with it is because when I put the error message in Access Help it returned about 4 results one of which was how to use access with sql server but i never found anything connected to the error in the help it gave me. If you would like me to post some of my vba code let me know but I can't find anything in it that is setting it off, i have tried different ways of saving the records, I have even created a save button and add new record button using the wizards and I still seem to get the errors. Anyone have any ideas?
 
Save record

I have had this same problem numerous times. I am using several Access front ends for SQL Server database files. The last time I received the message was yesterday in response to programmatically assigning values to text boxes and row sources to combo boxes based upon opening a form. I do this because I am reusing one form and need to have different values accordingly. After I fill in all the data and set the row sources, I save the record because I have mulitple users. I simply added a text box set focus line of code just before the save record line of code. I can't tell you why it works but for some reason, it will now allow the save.
 
Thanks for the tip. Its seems to be working now. Since you are familiar with SQL maybe you can also help me with another problem I am having. Say I have a form and it is adding data to a table with one field and that field is the primary key (so no duplicates are allowed) now if i open access and then the form and try and enter in a name that is already in the primary key field it will let me know that duplicates are not allowed. however when i enter in a new name in the field and then submit it I can enter that same name again and again and again without recieving the duplicate error message. I can even close the form and reopen it and I will still be able to re-enter the new fields I had just put in the form the previous time. The only time it gives me the duplicate error message is when I close the database completely down and reopen it. It seems as though access keeps the original data that it got from the sql server in local memory but when a new record is added it doesn't refresh its list. Do you know of any way to fix this?
 
Save Record

I need a little more information before I can attempt to answer your question. Are you using an Access .adp or .mdb file? What type of recordsource do you have for this form (table, SQL statement, etc)? The SQL table itself WILL NOT allow duplicate key entries if there is indeed a primary key set up for the table. Check your SQL table data and see if there are any actual duplicate entries.

Jen
 
I regret to inform you that I am still having the SaveRecord error message, I guess I just didn't do enough testing.
 
I am using a adp database. The record source is ClassTbl the record source qualifier is dbo, the Recordset Type is Updateable Snapshot. I have checked the database and there are no actual duplicate entries but I would still like to have the error message pop up to inform the user that what they entered is already in the database. Thanks for your help.
 
Have you manually or programmatically suppressed error messages or data warnings? I turn them off and on in code to avoid confusion for the users. Normally, an adp will let you know if it doesn't add data to the table. I have discovered that an adp can be very hard to work with and it can be very hard to determine what is actually causing the problem.
 
I have turned off a couple of errors that appeared when it tried to save the current data in the fields when I closed the form and it would say somthing like "insert failed, you cannot insert a null field into ClassTbl" so now on the beforeUpdate() i check for only that error message number and if it does occur i tell it to cancel and autmatically respond yes to the following message box that asks if I "want to close without saving". Those are the only dealings I've had with surpressing error messages in the database, you could be right about it because it seems right after I figured out how to suppress the error messages it started to pop up these new errors. Do you have any kind of solution in mind, if so I will have to test it on monday because I am no longer at the office. Thanks
 

Users who are viewing this thread

Back
Top Bottom