DMax MultiUser (1 Viewer)

gizmogeek

Registered User.
Local time
Today, 08:22
Joined
Oct 3, 2007
Messages
95
I need some help with DMax multi user.

I don't get a PO number and when I click on my subform I can't change the values because it says I need to add multi user.

Also code that Chris O and RainLover had references additional fields which I don't have. I only have the one field that needs updating.

I have PONumber textbox and tbl.Purchase with the field PO

Here's the code I used.

Private Sub PONumber_AfterUpdate()

If (conHandleErrors) Then On Error GoTo ErrorHandler

' If we have some data
If Len(Me!PONumber) Then

' Find the highest number and increase it by ONE.
Me!PONumber = Nz(DMax("[PONumber]", "tblPurchaseOrder", "[PO] = '" & Me!PONumber & "'"), 0) + 1
Else
MsgBox "A String is Required", vbInformation, "Missing Information"
Screen.PreviousControl.SetFocus
Me.Undo
End If

' Added 03/02/2011 by Rainlover.
Me.txtConcatenated = Me.txtmyLetter & Me.txtmyNumber
Me.Refresh

ExitProcedure:
Exit Sub

ErrorHandler:
DisplayError "PONumber_AfterUpdate", Me.Name
Resume ExitProcedure

End Sub


Private Sub Form_Error(ByRef intDataErr As Integer, ByRef intResponse As Integer)

' Designed by ChrisO.

' If in a multiuser environment it is quite possible for more that one
' machine to attempt to write the same value which will cause a Form Error.
' Handle the error and exit the Sub.

' Is it a duplicate index value error?
If intDataErr = 3022 Then
' Ignore the data error.
intResponse = acDataErrContinue

' Set the timer handler and interval.
Me.OnTimer = "=BumpTheNumber()"
Me.TimerInterval = 1
End If

End Sub

Thanks!
 

RainLover

VIP From a land downunder
Local time
Today, 22:22
Joined
Jan 5, 2009
Messages
5,041
Gizmo

This is for advanced users. It is not a copy paste type of thing.

If you can't follow what's going on I strongly suggest that you use the single user version.
 

gizmogeek

Registered User.
Local time
Today, 08:22
Joined
Oct 3, 2007
Messages
95
I did not copy and paste I filled in my info but do not have the extra fields that you have an was wondering if you were using them to hold the number in one of the fields until update to ensure that no one else pulled that number.
 

RainLover

VIP From a land downunder
Local time
Today, 22:22
Joined
Jan 5, 2009
Messages
5,041
One of the other things this version does is to have a count on different things.

e.g.

Horse 1, Horse 2 etc then Cow 1, Cow 2, Cow 3 etc.
 

Users who are viewing this thread

Top Bottom