J
jwrnana
When entering information in my database, following procedure followed:
1. Create customer information
2. Create product info if not already entered
3. Enter order for customer - product, quantity, description, price, etc.
4. At bottom of screen 3 above, there is a tab to enter Shipping
information.
Sometimes (most of the time) this works fine. The command button,
Shipping Information opens a form in which shipping information is entered.
When closing the form, the following message is appearing:
WRITE CONFLICT
This record has been changed by another user since you started editing it.
If you save the record, you will overwrite the changes the other user made.
Copying the changes to the clipboard will let you look at the values the
other user entered, and then past your changes back in if you decide to make
changes.
Save Record Copy to Clipboard Drop Changes
If I chose drop changes, my order information remains - but the current date
is input in the order date rather than the date that I had entered. I can
go to shipping information, and the information is still there. Exit out
and no error appears. I can go back in and enter correct order date and it
remains, and ship to information is also still there.
I tried entering everything EXCEPT the shipping information, closing the
form and then going back and entering the shipping information and then I
get no errors.
If I copy to clipboard, what I see are the field names of the order form.
Following is the SQL info for this:
Option Compare Database
Private Sub Form_Current()
If IsNull(Me![OrderID]) Then
DoCmd.GoToControl "OrderID"
End If
End Sub
Private Sub Form_Open(Cancel As Integer)
If Not IsLoaded("Orders by Customer") Then
MsgBox "Open the Orders form using the Orders button on the Orders
by Customer form."
Cancel = True
End If
End Sub
Private Sub Form_Activate()
On Error GoTo Err_Form_Activate
Me.Requery
If IsLoaded("Orders by Customer") Then
If Forms![Orders by Customer]![Orders by Customer
Subform].Form.RecordsetClone.RecordCount > 0 Then
DoCmd.GoToControl "OrderID"
DoCmd.FindRecord Forms![Orders by Customer]![Orders by Customer
Subform].Form![OrderID]
End If
End If
Exit_Form_Activate:
Exit Sub
Err_Form_Activate:
MsgBox Err.Description
Resume Exit_Form_Activate
End Sub
Private Sub EmployeeID_NotInList(NewData As String, Response As Integer)
MsgBox "Double-click this field to add an entry to the list."
Response = acDataErrContinue
End Sub
Private Sub EmployeeID_DblClick(Cancel As Integer)
On Error GoTo Err_EmployeeID_DblClick
Dim lngProductID As Long
If IsNull(Me![EmployeeID]) Then
Me![EmployeeID].Text = ""
Else
lngProductID = Me![EmployeeID]
Me![EmployeeID] = Null
End If
DoCmd.OpenForm "Employees", , , , , acdialog, "GotoNew"
Me![EmployeeID].Requery
If lngProductID <> 0 Then Me![EmployeeID] = lngProductID
Exit_EmployeeID_DblClick:
Exit Sub
Err_EmployeeID_DblClick:
MsgBox Err.Description
Resume Exit_EmployeeID_DblClick
End Sub
Private Sub Order_Details_Subform_Enter()
On Error GoTo Err_Order_Details_Subform_Enter
If IsNull(Me![OrderID]) Then
Me![OrderDate] = Date
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
End If
Exit_Order_Details_Subform_Enter:
Exit Sub
Err_Order_Details_Subform_Enter:
MsgBox Err.Description
Resume Exit_Order_Details_Subform_Enter
End Sub
Private Sub ShippingMethodID_NotInList(NewData As String, Response As
Integer)
MsgBox "Double-click this field to add an entry to the list."
Response = acDataErrContinue
End Sub
Private Sub ShippingMethodID_DblClick(Cancel As Integer)
On Error GoTo Err_ShippingMethodID_DblClick
Dim lngShippingMethodID As Long
If IsNull(Me![ShippingMethodID]) Then
Me![ShippingMethodID].Text = ""
Else
lngShippingMethodID = Me![ShippingMethodID]
Me![ShippingMethodID] = Null
End If
DoCmd.OpenForm "Shipping Methods", , , , , acdialog, "GotoNew"
Me![ShippingMethodID].Requery
If lngShippingMethodID <> 0 Then Me![ShippingMethodID] =
lngShippingMethodID
Exit_ShippingMethodID_DblClick:
Exit Sub
Err_ShippingMethodID_DblClick:
MsgBox Err.Description
Resume Exit_ShippingMethodID_DblClick
End Sub
Private Sub ShippingOptions_Click()
On Error GoTo Err_ShippingOptions_Click
If IsNull(Me![OrderID]) Then
Me![OrderDate] = Date
End If
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.OpenForm "Shipping Information", , , "[OrderID] =
forms![Orders]![OrderID]", , acdialog
Exit_ShippingOptions_Click:
Exit Sub
Err_ShippingOptions_Click:
MsgBox Err.Description
Resume Exit_ShippingOptions_Click
End Sub
Private Sub Command39_Click()
On Error GoTo Err_Command39_Click
DoCmd.Close
Exit_Command39_Click:
Exit Sub
Err_Command39_Click:
MsgBox Err.Description
Resume Exit_Command39_Click
End Sub
Private Sub Shipping_To_Information_Click()
On Error GoTo Err_Shipping_To_Information_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Shipping Information"
stLinkCriteria = "[CustomerID]=" & Me![CustomerID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Shipping_To_Information_Click:
Exit Sub
Err_Shipping_To_Information_Click:
MsgBox Err.Description
Resume Exit_Shipping_To_Information_Click
End Sub
Private Sub Close_Orders_Form_Click()
On Error GoTo Err_Close_Orders_Form_Click
DoCmd.Close
Exit_Close_Orders_Form_Click:
Exit Sub
Err_Close_Orders_Form_Click:
MsgBox Err.Description
Resume Exit_Close_Orders_Form_Click
End Sub
I have probably given you too much information, my apologies. I have XP
Pro.
Thank you for your suggestions.
1. Create customer information
2. Create product info if not already entered
3. Enter order for customer - product, quantity, description, price, etc.
4. At bottom of screen 3 above, there is a tab to enter Shipping
information.
Sometimes (most of the time) this works fine. The command button,
Shipping Information opens a form in which shipping information is entered.
When closing the form, the following message is appearing:
WRITE CONFLICT
This record has been changed by another user since you started editing it.
If you save the record, you will overwrite the changes the other user made.
Copying the changes to the clipboard will let you look at the values the
other user entered, and then past your changes back in if you decide to make
changes.
Save Record Copy to Clipboard Drop Changes
If I chose drop changes, my order information remains - but the current date
is input in the order date rather than the date that I had entered. I can
go to shipping information, and the information is still there. Exit out
and no error appears. I can go back in and enter correct order date and it
remains, and ship to information is also still there.
I tried entering everything EXCEPT the shipping information, closing the
form and then going back and entering the shipping information and then I
get no errors.
If I copy to clipboard, what I see are the field names of the order form.
Following is the SQL info for this:
Option Compare Database
Private Sub Form_Current()
If IsNull(Me![OrderID]) Then
DoCmd.GoToControl "OrderID"
End If
End Sub
Private Sub Form_Open(Cancel As Integer)
If Not IsLoaded("Orders by Customer") Then
MsgBox "Open the Orders form using the Orders button on the Orders
by Customer form."
Cancel = True
End If
End Sub
Private Sub Form_Activate()
On Error GoTo Err_Form_Activate
Me.Requery
If IsLoaded("Orders by Customer") Then
If Forms![Orders by Customer]![Orders by Customer
Subform].Form.RecordsetClone.RecordCount > 0 Then
DoCmd.GoToControl "OrderID"
DoCmd.FindRecord Forms![Orders by Customer]![Orders by Customer
Subform].Form![OrderID]
End If
End If
Exit_Form_Activate:
Exit Sub
Err_Form_Activate:
MsgBox Err.Description
Resume Exit_Form_Activate
End Sub
Private Sub EmployeeID_NotInList(NewData As String, Response As Integer)
MsgBox "Double-click this field to add an entry to the list."
Response = acDataErrContinue
End Sub
Private Sub EmployeeID_DblClick(Cancel As Integer)
On Error GoTo Err_EmployeeID_DblClick
Dim lngProductID As Long
If IsNull(Me![EmployeeID]) Then
Me![EmployeeID].Text = ""
Else
lngProductID = Me![EmployeeID]
Me![EmployeeID] = Null
End If
DoCmd.OpenForm "Employees", , , , , acdialog, "GotoNew"
Me![EmployeeID].Requery
If lngProductID <> 0 Then Me![EmployeeID] = lngProductID
Exit_EmployeeID_DblClick:
Exit Sub
Err_EmployeeID_DblClick:
MsgBox Err.Description
Resume Exit_EmployeeID_DblClick
End Sub
Private Sub Order_Details_Subform_Enter()
On Error GoTo Err_Order_Details_Subform_Enter
If IsNull(Me![OrderID]) Then
Me![OrderDate] = Date
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
End If
Exit_Order_Details_Subform_Enter:
Exit Sub
Err_Order_Details_Subform_Enter:
MsgBox Err.Description
Resume Exit_Order_Details_Subform_Enter
End Sub
Private Sub ShippingMethodID_NotInList(NewData As String, Response As
Integer)
MsgBox "Double-click this field to add an entry to the list."
Response = acDataErrContinue
End Sub
Private Sub ShippingMethodID_DblClick(Cancel As Integer)
On Error GoTo Err_ShippingMethodID_DblClick
Dim lngShippingMethodID As Long
If IsNull(Me![ShippingMethodID]) Then
Me![ShippingMethodID].Text = ""
Else
lngShippingMethodID = Me![ShippingMethodID]
Me![ShippingMethodID] = Null
End If
DoCmd.OpenForm "Shipping Methods", , , , , acdialog, "GotoNew"
Me![ShippingMethodID].Requery
If lngShippingMethodID <> 0 Then Me![ShippingMethodID] =
lngShippingMethodID
Exit_ShippingMethodID_DblClick:
Exit Sub
Err_ShippingMethodID_DblClick:
MsgBox Err.Description
Resume Exit_ShippingMethodID_DblClick
End Sub
Private Sub ShippingOptions_Click()
On Error GoTo Err_ShippingOptions_Click
If IsNull(Me![OrderID]) Then
Me![OrderDate] = Date
End If
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.OpenForm "Shipping Information", , , "[OrderID] =
forms![Orders]![OrderID]", , acdialog
Exit_ShippingOptions_Click:
Exit Sub
Err_ShippingOptions_Click:
MsgBox Err.Description
Resume Exit_ShippingOptions_Click
End Sub
Private Sub Command39_Click()
On Error GoTo Err_Command39_Click
DoCmd.Close
Exit_Command39_Click:
Exit Sub
Err_Command39_Click:
MsgBox Err.Description
Resume Exit_Command39_Click
End Sub
Private Sub Shipping_To_Information_Click()
On Error GoTo Err_Shipping_To_Information_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Shipping Information"
stLinkCriteria = "[CustomerID]=" & Me![CustomerID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Shipping_To_Information_Click:
Exit Sub
Err_Shipping_To_Information_Click:
MsgBox Err.Description
Resume Exit_Shipping_To_Information_Click
End Sub
Private Sub Close_Orders_Form_Click()
On Error GoTo Err_Close_Orders_Form_Click
DoCmd.Close
Exit_Close_Orders_Form_Click:
Exit Sub
Err_Close_Orders_Form_Click:
MsgBox Err.Description
Resume Exit_Close_Orders_Form_Click
End Sub
I have probably given you too much information, my apologies. I have XP
Pro.
Thank you for your suggestions.