Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help using "DMAX"

Status
Not open for further replies.

punky001

Programmer
Oct 1, 2007
34
US
I have an issue with an old database I inherited. I have updated to Access 2007 front-end and moved the back-end to SQL.
The field in question is called “Number” with field type of Int. This field is populated from the form based on the following calc:
=DMax("[Number]","[RequiredReportTable]","[ContractNumber] =" & [Forms]![AddRequiredReportForm]![ContractNumber])+1

The table – RequiredReportTable – has a number of different Contract numbers. Each time a record is added for a specific contract nr – the “Number” field should increase by 1 – only for that contract nr. This works most of the time – but sometimes it skips numbers – which means it appears as though records may have been deleted.
I can’t figure out why it is skipping numbers. Can anyone help? Is there a better way to do this?
 
Where in the form is this DMax() function?

(RG for short) aka Allan Bunch MS Access MVP acXP, ac07 ac10 - winXP Pro, Win7 Pro
Please respond to this forum so all may benefit
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top