Hi,
Where i am making a mistake???
Code:
Private Sub btn1_Click()
Dim dbCode As DAO.Database
Dim rstCode As DAO.Recordset
Set dbCode = CurrentDb
Set rstCode = dbCode.OpenRecordset("tblCode")
Dim strCheck As String
strCheck = Me.MainID.Value
With rstCode
.FindFirst "[MainID]=" & strCheck
End With
rstCode.Close
Set rstCode = Nothing
Set dbCode = Nothing
End Sub
When btn1 is click to findfirst in the tblCode.MainID
Where i am making a mistake???
Code:
Private Sub btn1_Click()
Dim dbCode As DAO.Database
Dim rstCode As DAO.Recordset
Set dbCode = CurrentDb
Set rstCode = dbCode.OpenRecordset("tblCode")
Dim strCheck As String
strCheck = Me.MainID.Value
With rstCode
.FindFirst "[MainID]=" & strCheck
End With
rstCode.Close
Set rstCode = Nothing
Set dbCode = Nothing
End Sub
When btn1 is click to findfirst in the tblCode.MainID