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

Wrong record is getting updated....

Status
Not open for further replies.

Pack10

Programmer
Feb 3, 2010
495
US
I hope I can explain this properly. I have two split forms, one is Manager_Queue and one is Assigned_Queue.
Depending on whether the user is a manager or workerbee they select a record from one screen or the other.
The workerbee cannot open the record from the manager queue.

On rare occasions we have had a record overwrite another.
Here is the snippet of code that I think is causing my issue. How can I clean it up? Thanks

' open recordsets
Set db = CurrentDb

'Depending on which form is open run the sql

If IsOpen("Manager Queue") Then
If Forms![Manager Queue].Form.RecordsetClone.RecordCount <> 0 Then
sSQL = "SELECT Assigned_DDQs.* FROM Assigned_DDQs WHERE Parent = " & Forms![Manager Queue]![Parent]
End If
End If

If IsOpen("Assigned_List") Then
sSQL = "SELECT Assigned_DDQs.* FROM Assigned_DDQs WHERE Parent = " & Me.txtItem
End If


Set rst = db.OpenRecordset(sSQL)
With rst

.Edit
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top