sundaram
Registered User.
- Local time
- Today, 17:47
- Joined
- May 28, 2009
- Messages
- 36
Dear Frinds,
I am very freshner
Iam trying to find Serial No of Employee register.
SlNo is Long Integer (Data Type)
Dim IntSql as integer
Dim StrCri as String
I am trying, it is showing error Run time ‘3464’:
Data type mismatch in criteria expression.
I tried SlNo to Text (DATA Type)
As per below I getting the right result.
Please advise me how to get the result. With integer data type
In a form vb
Dim StrSql As String
Dim StrCri As String
Dim X As String
X = rst.Fields("Sr#").Value
StrCri = InputBox("Enter the Serial NO", "Enter number/", "Question/")
If Len(StrCri) = 0 Then
MsgBox Prompt:="No Criteria Specified", Title:="Search tblEmp.MDB"
Exit Sub
End If
StrSql = "SlNo='" & Trim(StrCri) & "'"
rst.FindFirst StrSql
If rst.NoMatch = False Then
Movefields
Else
MsgBox "Not Found."
rst.MoveFirst
End If
I am very freshner
Iam trying to find Serial No of Employee register.
SlNo is Long Integer (Data Type)
Dim IntSql as integer
Dim StrCri as String
I am trying, it is showing error Run time ‘3464’:
Data type mismatch in criteria expression.
I tried SlNo to Text (DATA Type)
As per below I getting the right result.
Please advise me how to get the result. With integer data type
In a form vb
Dim StrSql As String
Dim StrCri As String
Dim X As String
X = rst.Fields("Sr#").Value
StrCri = InputBox("Enter the Serial NO", "Enter number/", "Question/")
If Len(StrCri) = 0 Then
MsgBox Prompt:="No Criteria Specified", Title:="Search tblEmp.MDB"
Exit Sub
End If
StrSql = "SlNo='" & Trim(StrCri) & "'"
rst.FindFirst StrSql
If rst.NoMatch = False Then
Movefields
Else
MsgBox "Not Found."
rst.MoveFirst
End If