Sequential numbering (1 Viewer)

Wozza

New member
Local time
Today, 14:24
Joined
May 19, 2020
Messages
13
Hi,

I am trying to create a unique case study reference number based on project ID and then a number. So far I have created a query which gives me the number, however, I can't then update the generated number into my table (I know it has something to do with the query not being updateable). I would also like this case study reference to be generated when a new case study record is entered in a form.
Figure 1 - the query to generate the CS-ref.
1605545519038.png

2. The generated Case study reference number generated from the query
1605545553147.png


3. The Case study table - I would like the CS_ref created above to go in the CS_ref field in this table.

1605545614276.png


My VB coding is limited but I feel coding maybe the better way to go? Any help would be very gratefully received.

Many thanks
Sue
 

theDBguy

I’m here to help
Staff member
Local time
Today, 07:24
Joined
Oct 29, 2018
Messages
21,357
Hi Sue. Couldn't you just use a query to show the sequential numbers rather than store them in the table? Just curious...
 

CJ_London

Super Moderator
Staff member
Local time
Today, 14:24
Joined
Feb 19, 2013
Messages
16,553
it may be my monitor, but can only read the second image (and number is a reserved word and should not be used as a field name)

Also not clear if this is numeric or text. Right justified implies number, the preceding zeros implies text.

suggest investigate using what is commonly called dmax+1
 

Wozza

New member
Local time
Today, 14:24
Joined
May 19, 2020
Messages
13
Hi Sue. Couldn't you just use a query to show the sequential numbers rather than store them in the table? Just curious...
Hi, the table is used in other databases so ideally would like the numbers stored in the table, but totally get your point.
 

Wozza

New member
Local time
Today, 14:24
Joined
May 19, 2020
Messages
13
it may be my monitor, but can only read the second image (and number is a reserved word and should not be used as a field name)

Also not clear if this is numeric or text. Right justified implies number, the preceding zeros implies text.

suggest investigate using what is commonly called dmax+1
OK, thanks, I will have a look at DMAX + 1
 

Users who are viewing this thread

Top Bottom