Help with Saving a Record

gguy

Registered User.
Local time
Today, 22:24
Joined
Jun 27, 2002
Messages
104
I have a form that is bound to a table. The form contain a command button to print a license from the fields entered on the form.

The print works but the record does not save to the table.

I have checked the form properties and add, change, delete and data entry are "yes".

I have put a docmd.save in the "on click" of the print command button. No errors occur but the record is not save to the table.

I also tried "DoCmd.RunCommand acCmdSaveRecord" in the "on click" but I get a runtime error that says it can't complete because it would create a duplicate value in the index, primary key or relationship.
I can't see any dup unless it is trying to save the record twice in the same function. Thanks, GGuy
 
First before you execute print add a record and see if it saves to the table, if it does then check your primary key, is it an auto number or a specific number that you as primary. When you get a warning that you are creating a duplicate that means that the system recognizes a record in the table, are you using the find method (binoculars) before entering a new record.
check under properties/data/ data entry should be NO, that will let you see the total of records from the table on the form.
Let me know.
Dennis

if you cannot do it send me a copy so I can look at it.
 
I already had a button that would close the form without a print but it still will not save the record.

I tried creating a new form through the wizard but it would not save the record either. The funny part is that if I don't put a save command in the "on click" I don't get any error messages and record goes away. I have looked through the code for an undo. I am not seeing it!

I cleared all the data out of the data base and still got the same problem.

I am using a switchboard and had the form opening in add mode but I switched that to edit. Also set data entry to "no" as you said and I can see the total number of records go up by one as I enter a new record but when I close the record the total number of records drops back.

How can I send you a copy? GGuy
 

Users who are viewing this thread

Back
Top Bottom