steve ferry
Registered User.
- Local time
- Today, 01:10
- Joined
- Aug 9, 2005
- Messages
- 12
Problem Multi-level numbering.
I consider myself a moderate user of access a little out of my depth here I hope someone can help.
I have a multi level numbering system based on the Dmax function as follows:
Me!SEQEL = Nz(DMax("[SEQEL]", "[Task_Analysis_Elements]", "[Related Job Position TA] = '" & RJPT & "' AND [Related Duty Area TA] = '" & RDAT & "' AND [Related SEQ TA] = '" & RST & "'")) + 1
My counter is SEQEL.
The table referencing is Task_Analysis_Elements.
The Criterea: "[Related Job Position TA] = '" & RJPT & "' AND [Related Duty Area TA] = '" & RDAT & "' AND str$([Related SEQ TA]) = '" & RST &"'".
The above checks criteria in three fields.
The trouble arises in the Dmax function that the criteria is a string expression.
[Related Job Position TA] and [Related Duty Area TA] are both strings in there respective tables whilst ([Related SEQ TA]) is a Number and has to remain so.
So I thought okay I'd use the string function "str$" to tell access to get the value from the respective table and treat it as a string.
Problem is it not working my counter SEQEL will not go beyond 1.
Am I missing something fundamental?
The code is and after_update event procedure based on a required field on the form.
thanks
Steve Ferry
I consider myself a moderate user of access a little out of my depth here I hope someone can help.
I have a multi level numbering system based on the Dmax function as follows:
Me!SEQEL = Nz(DMax("[SEQEL]", "[Task_Analysis_Elements]", "[Related Job Position TA] = '" & RJPT & "' AND [Related Duty Area TA] = '" & RDAT & "' AND [Related SEQ TA] = '" & RST & "'")) + 1
My counter is SEQEL.
The table referencing is Task_Analysis_Elements.
The Criterea: "[Related Job Position TA] = '" & RJPT & "' AND [Related Duty Area TA] = '" & RDAT & "' AND str$([Related SEQ TA]) = '" & RST &"'".
The above checks criteria in three fields.
The trouble arises in the Dmax function that the criteria is a string expression.
[Related Job Position TA] and [Related Duty Area TA] are both strings in there respective tables whilst ([Related SEQ TA]) is a Number and has to remain so.
So I thought okay I'd use the string function "str$" to tell access to get the value from the respective table and treat it as a string.
Problem is it not working my counter SEQEL will not go beyond 1.
Am I missing something fundamental?
The code is and after_update event procedure based on a required field on the form.
thanks
Steve Ferry