I am having a problem with retrieving the information I am looking for. Basically I am checking to see if a user has selected a TRNumber from a drop down menu and if that TRNumber matches any other records in the table in that field. If it does, is that Number already associated with the user selecting it. If it is I want to get the ID number so I can simply update the record with new information. Here is what I have so far.
Code:
Dim Rs As DAO.Recordset
Dim Tech As String
Dim MsgStr As String
Dim IdMod As String
Set Rs = CurrentDb.OpenRecordset("PrepStartDateBlankQuery")
Tech = DLookup("ID", "UserReportsComboQuery")
MsgStr = "Another Technician has put a start date on this test request already. Do you want to update the test request with your information?"
If DCount("TRNumber", "PrepStartDateBlankQuery", "[TRNumber] ='" & Me.TRNCombo.Column(1) & "'") = 0 Then
MsgBox "ugg"
Exit Sub
'Use update query here
Else
If Not (Rs.EOF And Rs.BOF) Then
Rs.MoveFirst
With Rs
.FindFirst "TRNumber = '" & Me.TRNCombo.Column(1) & "'" And "TestTechnician = " & Tech
.MoveNext
End With
DoCmd.OpenQuery "UpdatePrepStartDateQuery"
Exit Sub
Else