If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Generating Unique Numbers on a Form with Multi-users
Hi there,
Hope someone can help me out. I am developing a little Db to help track documents. There will be around 6 users of the database and each document entered in needs a unique number to help keep track of it. The unique number (DocNo) is the primary key and is an Autonumber. This is what I think the sequence of events should be and what I've done to try and acheive my goal: 1. Set the focus to the DocSent field (so uses can enter the date). As soon as user starts typing new doc no. displays [Me.DocSentDate.SetFocus in OnCurrent Event]. 2. User enters the current date and then TABs or clicks in the next field and the form is refreshed to add the new doc no. to the dataset to ensure it is not used again [Me.Refresh in BeforeUpdate Event of DocSentDate field]. At step two I get an error: Run-time error ‘2115’ – the macro or function set to the BeforeUpdate or ValidationRule property for this field is preventing Access from saving the data in the field. I would also like to have some compulsory fields but this doesn't seem possible if you're going to use the Me.Refresh command ... or without a lot of serious programming. Can anyone help me please? Many thanks, Nerida. -- Cheers, Nerida Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200612/1 |
#2
|
|||
|
|||
Generating Unique Numbers on a Form with Multi-users
If DocSent is an Autonumber field, there's no need to do anything to ensure
that it's generated and is unique. Remove the Me.Refresh, and you should be fine. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "Nerida via AccessMonster.com" u15138@uwe wrote in message news:6ac7b8d962058@uwe... Hi there, Hope someone can help me out. I am developing a little Db to help track documents. There will be around 6 users of the database and each document entered in needs a unique number to help keep track of it. The unique number (DocNo) is the primary key and is an Autonumber. This is what I think the sequence of events should be and what I've done to try and acheive my goal: 1. Set the focus to the DocSent field (so uses can enter the date). As soon as user starts typing new doc no. displays [Me.DocSentDate.SetFocus in OnCurrent Event]. 2. User enters the current date and then TABs or clicks in the next field and the form is refreshed to add the new doc no. to the dataset to ensure it is not used again [Me.Refresh in BeforeUpdate Event of DocSentDate field]. At step two I get an error: Run-time error '2115' - the macro or function set to the BeforeUpdate or ValidationRule property for this field is preventing Access from saving the data in the field. I would also like to have some compulsory fields but this doesn't seem possible if you're going to use the Me.Refresh command ... or without a lot of serious programming. Can anyone help me please? Many thanks, Nerida. -- Cheers, Nerida Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200612/1 |
Thread Tools | |
Display Modes | |
|
|