Disappearing Data

User avatar
HansV
Administrator
Posts: 78481
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Disappearing Data

Post by HansV »

Open the GIN table in datasheet view.
Delete all existing records.
Close the table.

On the Database Tools tab of the ribbon, click Relationships.
Delete the relationship between GIN and Stock Activity.
Close the Relationships window.

Open the GIN table in design view.
Delete the ID field.
Change the GINNO field to an AutoNumber field, and make it the Primary Key.
Close and save the table.

Open the Relationships window again.
Create a relationship between GIN and Stock Activity on GINNO vs Refence Number.
Close the Relationships window.

Start creating a new query in design view.
Close the Show Table dialog without adding any tables.
Switch to SQL view.
Make the SQL String look like this:

INSERT INTO GIN (GINNO) Values (999)

where 999 is one less than the starting number you want to use.
Click Run (the button with the red exclamation mark), and confirm.
You can discard the query, or save it for reuse later on.

Open the GIN table. You'll see one record, with the value you specified in the query in the GINNO field.
Delete this record, then close the GIN table.

Next time you, or anyone else, creates a new record in the GIN table, GINNO will be the desired start number.
Best wishes,
Hans

keiath
StarLounger
Posts: 73
Joined: 08 Jan 2012, 15:07

Re: Disappearing Data

Post by keiath »

Works perfect thank you, and now I can use that for the other forms as well.

Again Thanks