Hi there,
I've looked through the archives and I am still struggling. So sorry if this is a re-post.
I am having trouble getting dmax command to work correctly.
I currently have a Form called
Input table
and a Table called
Store
On my input form is where users will enter their required fields... e.g.
Field 1
Field 2
Field 3
Field 4
Field 5
before hitting a button that allows the transfer of information to the Stores table.
What I do not want them to see is a unique ID number generated using dmax until such time that they have clicked the button and the record is stored.
This should be in "SUN0000000001" +1 increments
I have currently assigned the following to the button:
DoCmd.GoToRecord , , acNewRec
DoCmd.OpenTable "Store", acViewNormal, acReadOnly
DoCmd.GoToRecord acTable, "Store", acLast
DoCmd.RunMacro "Macro1", 1
Some of that is irrelevant but it gives you the idea. So once they have filled in the information required they click the button and it adds the record and at the same time generates the unique number.
But now... every time I try add code to allow the dmax command to create a SUN0000000001 +1 number it swears at me.
I'm no big VBA fundie so if you could help me out here I'd appreciate it.
I hear that adding year and custom code allows for more unique number but all I am worried about for now is getting it working be it with or without dates.
Muchly appreciated
Cheers
solbane
I've looked through the archives and I am still struggling. So sorry if this is a re-post.
I am having trouble getting dmax command to work correctly.
I currently have a Form called
Input table
and a Table called
Store
On my input form is where users will enter their required fields... e.g.
Field 1
Field 2
Field 3
Field 4
Field 5
before hitting a button that allows the transfer of information to the Stores table.
What I do not want them to see is a unique ID number generated using dmax until such time that they have clicked the button and the record is stored.
This should be in "SUN0000000001" +1 increments
I have currently assigned the following to the button:
DoCmd.GoToRecord , , acNewRec
DoCmd.OpenTable "Store", acViewNormal, acReadOnly
DoCmd.GoToRecord acTable, "Store", acLast
DoCmd.RunMacro "Macro1", 1
Some of that is irrelevant but it gives you the idea. So once they have filled in the information required they click the button and it adds the record and at the same time generates the unique number.
But now... every time I try add code to allow the dmax command to create a SUN0000000001 +1 number it swears at me.
I'm no big VBA fundie so if you could help me out here I'd appreciate it.
I hear that adding year and custom code allows for more unique number but all I am worried about for now is getting it working be it with or without dates.
Muchly appreciated
Cheers
solbane