Incrementing a number for each row

  • Thread starter Thread starter DontKnow
  • Start date Start date
D

DontKnow

Hi Guys,

I need some help in numbering incremental rows for a particular project.

For instance if I have 3 records I am trying to have the name of the
project, a slash and then the nuber of the record.

ie.
RecordNo: Type projectRisk
Record1 Risk 02033/1
Record2 Risk 02033/2
Record3 Risk 02033/3

You see under Project Risk. This is what I am trying to do!
I am able to produce the autonumber of rows but not the 02033/1,2,3 etc All
I am able to get is 02033/1 for all three records using the Default entry in
properties
..
I have tried for several days but to no avail!!

how can I do this??
I am using a subform in datasheet view!!

Cheers
 
On Wed, 3 Dec 2008 17:36:01 -0800, DontKnow

Why is this important? Unlike the perhaps more familiar Excel
environment in a relational database one hardly ever needs sequential
numbering like this. It often points to a misunderstanding of how
things work in a db as opposed to a spreadsheet. If you could
elaborate, perhaps we can suggest alternatives.

-Tom.
Microsoft Access MVP
 
Its for a risk database so that when somone looks at a risk register someone
can see the number of a risk. Depending on the allocated risk whether it is
high medium or low is transferred to another table. This allocated number
allows the managers to easily see from where the risk came from and from
which project.

ie. 02008/1 refers to a risk from maitland and is the first risk etc

I hope this is clearer!!

Cheers
 
DontKnow said:
Hi Guys,

I need some help in numbering incremental rows for a particular
project.

For instance if I have 3 records I am trying to have the name of the
project, a slash and then the nuber of the record.

ie.
RecordNo: Type projectRisk
Record1 Risk 02033/1
Record2 Risk 02033/2
Record3 Risk 02033/3

You see under Project Risk. This is what I am trying to do!
I am able to produce the autonumber of rows but not the 02033/1,2,3
etc All I am able to get is 02033/1 for all three records using the
Default entry in properties

I would say that the project should be in a master record and the risks in a
related table

ProjectRisk would be calculated with ProjectRisk:ProjectID &"/"& RiskNumber.
in a query.

If Is Null RiskNumber then
RiskNumber = 1
else
RiskNumber = DMax ("RiskNumber", "RiskNumberTable", "ProjectID = " &
someField) + 1
End If
 
Hi Mike,

Thanks for your reply!!

Where should I place this code??

Should I have a unbound or bound text box??

Please advise!!

Cheers,

thankks again for your help!!

This is quite difficult!!
 
ProjectRisk would be calculated with ProjectRisk:ProjectID &"/"& RiskNumber
in a query.
Build the query and add the above to as a field in the query.
 
Back
Top