Hello Ken and John
thanks for the warnings. i have no intention of maintaining a consecutive
number.
the problem is not making it an editable number or human friendly. the
problem is there are 2 columns that are being used by queires and mechanizms
that make things inefficient because i have to allow for both columns to be
the determining factor in the results of those queries and mechanizms.
the idea is that if i could make it all one column that is autonumbered
without upsetting the apple cart i could reduce some of the bog in my code,
queries and the overall performance of the app.
it is just an idea, but something i might figure out how to do so i can get
rid of an extra column in my table and streamline a bunch of code.
the only problem is that everyone is used to the current set of numbers, so
i would like to maintain them as is. that means changing some auto numbers.
here is an example of a query i use that shows how often this situation
causes me grief:
SELECT DISTINCTROW
qryProductSiteInformation.SerialNumber,
IIf(tblWarrantyClaim!WarrantyClaimID<7000,tblWarrantyClaim!ClaimNumber,tblWarrantyClaim!WarrantyClaimID) AS [Claim #],
tblWarrantyClaim.DateofClaim,
tblWarrantyClaim.DateOfFailure,
tblWarrantyClaim.DateOfRepair,
tblWarrantyClaim.WarrantyClaimID,
qryProductSiteInformation.ProductID,
tblServiceReps.Name,
qryProductSiteInformation.ProductTypeID,
tblWarrantyClaim.DateApproved,
tblWarrantyClaim.DateRejected,
tblWarrantyClaim.DateCreditCreated,
tblWarrantyClaim.CreditNumber,
tblWarrantyClaim.WCDateDeleted,
qryAllWarrantyTotals.TotalParts,
qryAllWarrantyTotals.TotalLabour,
qryAllWarrantyTotals.TotalTravel,
qryAllWarrantyTotals.TotalOtherCredits,
IIf([TotalParts] Is Null,0,[TotalParts])+IIf([TotalLabour] Is
Null,0,[TotalLabour])+IIf([TotalTravel] Is
Null,0,[TotalTravel])+IIf([TotalOtherCredits] Is Null,0,[TotalOtherCredits])
AS WarrantyTotal,
subtblWarrantyStatus.Status,
qryAllWarrantyTotals.FirstOfReturnAuthorizationNumber AS RMA
FROM
subtblWarrantyStatus
RIGHT JOIN (tblServiceReps
RIGHT JOIN ((tblWarrantyClaim
LEFT JOIN qryProductSiteInformation
ON tblWarrantyClaim.ProductID = qryProductSiteInformation.ProductID)
LEFT JOIN qryAllWarrantyTotals
ON tblWarrantyClaim.WarrantyClaimID =
qryAllWarrantyTotals.WarrantyClaimID)
ON tblServiceReps.ServiceRepID = tblWarrantyClaim.ServiceRepID)
ON subtblWarrantyStatus.StatusID = tblWarrantyClaim.StatusID
GROUP BY
qryProductSiteInformation.SerialNumber,
IIf(tblWarrantyClaim!WarrantyClaimID<7000,tblWarrantyClaim!ClaimNumber,tblWarrantyClaim!WarrantyClaimID),
tblWarrantyClaim.DateofClaim,
tblWarrantyClaim.DateOfFailure,
tblWarrantyClaim.DateOfRepair,
tblWarrantyClaim.WarrantyClaimID,
qryProductSiteInformation.ProductID,
tblServiceReps.Name,
qryProductSiteInformation.ProductTypeID,
tblWarrantyClaim.DateApproved,
tblWarrantyClaim.DateRejected,
tblWarrantyClaim.DateCreditCreated,
tblWarrantyClaim.CreditNumber,
tblWarrantyClaim.WCDateDeleted,
qryAllWarrantyTotals.TotalParts,
qryAllWarrantyTotals.TotalLabour,
qryAllWarrantyTotals.TotalTravel,
qryAllWarrantyTotals.TotalOtherCredits,
IIf([TotalParts] Is Null,0,[TotalParts])+IIf([TotalLabour] Is
Null,0,[TotalLabour])+IIf([TotalTravel] Is
Null,0,[TotalTravel])+IIf([TotalOtherCredits] Is Null,0,[TotalOtherCredits]),
subtblWarrantyStatus.Status,
qryAllWarrantyTotals.FirstOfReturnAuthorizationNumber,
subtblWarrantyStatus.Order,
tblWarrantyClaim.DateofClaim
HAVING
(((tblWarrantyClaim.DateofClaim) Is Null
Or (tblWarrantyClaim.DateofClaim) Between
[Forms]![frmManageAssets]![txtDateofClaimFromHidden] And
[Forms]![frmManageAssets]![txtDateofClaimToHidden])
AND ((qryProductSiteInformation.ProductID) Like
[forms]![frmManageAssets]![txtProduct])
AND ((tblServiceReps.Name) Like [Forms]![frmManageAssets]![txtRepHidden]
& "*")
AND ((tblWarrantyClaim.CreditNumber) Like
[Forms]![frmManageAssets]![txtCreditNumberHidden] & "*" Or
(tblWarrantyClaim.CreditNumber) Is Null)
AND ((tblWarrantyClaim.WCDateDeleted) Is Null) AND
((subtblWarrantyStatus.Status) Like
[Forms]![frmManageAssets]![txtStatusHidden])
AND
((IIf([tblWarrantyClaim]![WarrantyClaimID]<7000,[tblWarrantyClaim]![ClaimNumber],[tblWarrantyClaim]![WarrantyClaimID]))
Like [Forms]![frmManageAssets]![txtClaimNumberHidden] & "*"
Or
(IIf([tblWarrantyClaim]![WarrantyClaimID]<7000,[tblWarrantyClaim]![ClaimNumber],[tblWarrantyClaim]![WarrantyClaimID])) Is Null))
ORDER BY
subtblWarrantyStatus.Order, tblWarrantyClaim.DateofClaim DESC ,
IIf([tblWarrantyClaim]![WarrantyClaimID]<7000,[tblWarrantyClaim]![ClaimNumber],[tblWarrantyClaim]![WarrantyClaimID]) DESC;
Notice the part that appears 3 times:
IIf(tblWarrantyClaim!WarrantyClaimID<7000,tblWarrantyClaim!ClaimNumber,tblWarrantyClaim!WarrantyClaimID)
it would be so much nicer if i could just go:
tblWarrantyClaim!WarrantyClaimID AS Claim #
dont you think?
[quoted text clipped - 15 lines]
If you want a sequential, human-meaningful ID, use a Long Integer number
field; you can use code on your data entry form to automatically increment it.