Adding increments to a field

ComptechRx

Registered User.
Local time
Today, 02:27
Joined
Mar 14, 2011
Messages
13
Hi All.. this is going to be tough to describe but hoping someone can give me an idea on how to accomplish what I need.

I have a query named qryActivityRefDetail based on some relational tables and is set as follows:

SELECT DISTINCT tblActivity.ID, [tblActivityType]![AcitivityTypeRefID] & "." & [SysRef] AS ActivityRef, tblActivity.RefID, tblActivityType.AcitivityTypeOrder, IIf([SystemLevelID]=1,[qryActivitySystems]![CombRef],IIf([SystemLevelID]=2,[qryActivitySubSystems]![CombRef],[qryActivityComponents]![CombRef])) AS SysRef, IIf([SystemLevelID]=1,[qryActivitySystems]![CombName],IIf([SystemLevelID]=2,[qryActivitySubSystems]![CombName],[qryActivityComponents]![CombName])) AS [SysName], tblActivity.ActivityTypeID, tblActivity.SystemLevelID
FROM tblActivityType INNER JOIN (qryActivitySystems RIGHT JOIN (qryActivitySubSystems RIGHT JOIN (qryActivityComponents RIGHT JOIN tblActivity ON qryActivityComponents.ActivityID = tblActivity.ID) ON qryActivitySubSystems.ActivityID = tblActivity.ID) ON qryActivitySystems.ActivityID = tblActivity.ID) ON tblActivityType.AcitivityTypeID = tblActivity.ActivityTypeID
ORDER BY tblActivityType.AcitivityTypeOrder, IIf([SystemLevelID]=1,[qryActivitySystems]![CombRef],IIf([SystemLevelID]=2,[qryActivitySubSystems]![CombRef],[qryActivityComponents]![CombRef]));

I then have a subform that shows the value of the ActivityRef field placed on another form. I then have a combo box with the Row source:

SELECT tblActivityType.AcitivityTypeID, tblActivityType.AcitivityTypeName, tblActivityType.AcitivityTypeOrder FROM tblActivityType ORDER BY tblActivityType.AcitivityTypeOrder;

Which is related to the display value in the sub-report for ActivityRef.

What we would like to happen is that when a new record gets added, it checks the ActivityRef based on the combo box selection and then adds an incremental value .1, .2, .3 etc to the ActivityRef value.

Clear as mudd?
TIA
 

Attachments

  • Database.jpg
    Database.jpg
    41.7 KB · Views: 109
Last edited:

Users who are viewing this thread

Back
Top Bottom