Problem when editing date in a form. (1 Viewer)

Mayfair86

New member
Local time
Today, 13:16
Joined
Jun 13, 2019
Messages
6
Morning all,

I've used access a lot over the past years but I've never got too involved with creating new databases, just using and modifying templates.

I am currently using an inventory template and over the years i have done some basic modifications to make it exactly what we need. I've had a few hiccups and issues along the way but I've always managed to fix them with a bit of googling.
The database I have been using has been working faultlessly for over a year now so I thought it was about time to turn it into a template so I can keep an inventory of other product categories (engine parts). However although to basic template works it seems to have created several 'bugs'. The first of which is it changed one of the forms 'allow edits' to a no. I managed to rectify this with a bit of help from this forum but I now have another issue which is annoying me and I cant seem to find a solution; I can add a product using a 'new product form', click 'Save', all goes well no issues, puts the correct data in the correct table etc, however if I then click on the record to edit any of the information, when I go to click save it comes up with an error: 'The changes you requested to the table were not successful because they would create duplicate values in the index, primary key or relationship. Change the data in the fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again'. If I click 'Ok' and then 'Save' again it then saves fine. I can then check the table and the data has updated successfully.

I very much consider myself a noob when it comes to coding, VB and macros etc so I have tried to follow some of the 'how to's but none of them seem to apply to my current situation.

Throughout all this my original database is working absolutely fine still with no issues.

Any help would be greatly appreciated before I bin the whole thing and give up.

Thanks
 

Minty

AWF VIP
Local time
Today, 13:16
Joined
Jul 26, 2013
Messages
10,355
Without seeing the database this will be hard to diagnose from your description.

As it's new if you compact and repair it, then zip it you should be able to upload it here for someone to look at.
 

Micron

AWF VIP
Local time
Today, 09:16
Joined
Oct 20, 2018
Messages
3,476
Assuming form controls are bound, if you can edit a record and commit the change in some other fashion (without the button) successfully then the place to start looking would be the button code. Instead of button, can you navigate off the record or perhaps even just close the form?
 

Mayfair86

New member
Local time
Today, 13:16
Joined
Jun 13, 2019
Messages
6
unfortunately even if I try and click off the form etc (not use the save button) it still comes up with the error.
Its under products and then clicking on any of the products, editing anything, then saving.

Unfortunately despite several attempts with different programs I cant get it to zip small enough to upload, I cant get it smaller than 2.5mb.
 

jdraw

Super Moderator
Staff member
Local time
Today, 09:16
Joined
Jan 23, 2006
Messages
15,364
Did you do Compact and Repair, then try zip?
If so, and the file is too large, then possible option:
-make a copy of the database
-remove all but a few records
-try zip again.

We only need enough records to highlight the issue.
 

Mayfair86

New member
Local time
Today, 13:16
Joined
Jun 13, 2019
Messages
6
I managed to really condense it down so here it is.

Thanks
 

Attachments

  • Stock Database Basic.zip
    1.4 MB · Views: 54

mike60smart

Registered User.
Local time
Today, 13:16
Joined
Aug 6, 2017
Messages
1,899
Hi

When you say it is under Products ?

Where are you actually getting the error? What do you actually click to get an error?
 

Mayfair86

New member
Local time
Today, 13:16
Joined
Jun 13, 2019
Messages
6
Hi, yes under products, then click on the product code, then edit any of the information then try clicking save and close.
 

mike60smart

Registered User.
Local time
Today, 13:16
Joined
Aug 6, 2017
Messages
1,899
Hi

What format has the database been saved as ?

I cannot get into design view of any of the objects??
 

mike60smart

Registered User.
Local time
Today, 13:16
Joined
Aug 6, 2017
Messages
1,899
Hi

Unable to edit any Form.

This database has been saved as a Template but when I try to Import all of the objects into a new Blank accdb only the tables are present.
 

Minty

AWF VIP
Local time
Today, 13:16
Joined
Jul 26, 2013
Messages
10,355
It looks like it's a sharepoint / webapp?

Hence no design view.
 

mike60smart

Registered User.
Local time
Today, 13:16
Joined
Aug 6, 2017
Messages
1,899
Thanks Minty

Having not seen this format previously I was a bit baffled
 

Mayfair86

New member
Local time
Today, 13:16
Joined
Jun 13, 2019
Messages
6
Do I need to save it as something other than Default? allow access or something?
 

jdraw

Super Moderator
Staff member
Local time
Today, 09:16
Joined
Jan 23, 2006
Messages
15,364
Guys,
I am not a sharepoint user. I was able to open the database and change the name of a Product then move off the record and it seems as if the change was saved.
I am running a subscription to
?version
16.0


I added "lski" to the Product Name.
I agree there is no design view?? And no SQL view in the query designer.

 

Attachments

  • Mayfair.PNG
    Mayfair.PNG
    23.1 KB · Views: 109

Users who are viewing this thread

Top Bottom