My code doesn't do what I want it to do (Still unresolved)
Hello All,
I'm trying to display a choosen record from a table with a record id that is a TEXT data type. A variation of this same code works correctly in another form where the record source is a table with a record id that is a AUTONUMBER data type.
The below code (Access 2000) displays the first record in the table.
Private Sub cmdTypeCodeSearch_Click()
On Error Resume Next
Dim strtyTypeCodeID As String
strtyTypeCodeID = GettyTypeCodeID
'Just put this in to verify record id
MsgBox "You selected " & strtyTypeCodeID & " for your record key"
If Not IsNull(strtyTypeCodeID) Then
Me.RecordsetClone.FindFirst "[tyTypeCodeID] = " & strtyTypeCodeID
If Not Me.RecordsetClone.NoMatch Then
Me.Bookmark = Me.RecordsetClone.Bookmark
Else
MsgBox "Record Not Found"
End If
Me.Refresh
End If
End Sub
Any guidance would be appreciated.
Dale
Hello All,
I'm trying to display a choosen record from a table with a record id that is a TEXT data type. A variation of this same code works correctly in another form where the record source is a table with a record id that is a AUTONUMBER data type.
The below code (Access 2000) displays the first record in the table.
Private Sub cmdTypeCodeSearch_Click()
On Error Resume Next
Dim strtyTypeCodeID As String
strtyTypeCodeID = GettyTypeCodeID
'Just put this in to verify record id
MsgBox "You selected " & strtyTypeCodeID & " for your record key"
If Not IsNull(strtyTypeCodeID) Then
Me.RecordsetClone.FindFirst "[tyTypeCodeID] = " & strtyTypeCodeID
If Not Me.RecordsetClone.NoMatch Then
Me.Bookmark = Me.RecordsetClone.Bookmark
Else
MsgBox "Record Not Found"
End If
Me.Refresh
End If
End Sub
Any guidance would be appreciated.
Dale
Last edited: