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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dup numbers being generated

Status
Not open for further replies.

DMBLuva

Technical User
Jul 16, 2008
27
0
0
US
Good Morning,

I created a database about a year ago that generates ID numbers that are unique and have the string "PD-" in front. Here is my coding:

Private Sub CreateNewIssue_Click()
Dim JobIDprefix As String
JobIDprefix = "PD-"

DoCmd.ShowAllRecords 'in case it's filtered
DoCmd.RunCommand acCmdRecordsGoToNew
Me.txtJobID.Value = JobIDprefix & DMax("id", "jobs")

It has worked PERFECTLY except within the last 3 weeks. I have done nothing to this coding to explain why all of a sudden it is creating duplicate numbers. It's having issues right at the runcommand.

Now, we did upgrade a couple months ago from 2003 version to 2007. I wasn't sure if this is what has caused the issue.

Anyone able to help? THANKS IN ADVANCE!!!
 

Perhaps
Code:
Me.txtJobID.Value = JobIDprefix & DMax("id", "jobs") [b][COLOR=red] + 1[/color][/b]

Randy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top