Dim rst1 As you
Dim temp As String
Strsearchname=InputBox (" input to find job number ", "to find the input")
Temp="select * from employee information table where working like '" & amp; Strsearchname & amp; "'
"The Set rst1=db. OpenRecordset (temp)
If rst1. EOF Then
The Do While rst1. EOF
MsgBox "found!"
Work number. Value=(" gonghaowu "https://bbs.csdn.net/topics/rst1
Name. The Value=https://bbs.csdn.net/topics/rst1 (" name ")
Jobs. Value=https://bbs.csdn.net/topics/rst1 (" post ")
Salary. Value=(" salary "https://bbs.csdn.net/topics/rst1
Length of service. Value=https://bbs.csdn.net/topics/rst1 (the "service")
Note. Value=https://bbs.csdn.net/topics/rst1 (" note ")
Rst1. MoveNext
Loop
The Else
MsgBox "not found"
End the If
Rst1. Close
End Sub
Ok, I am a novice, yesterday just contact Access, according to stroke at a dozen books, why can't use...
CodePudding user response:
Try the following 3 kinds ofTemp="select * from employee information table where work number='" & amp; Strsearchname & amp; "'
"Temp="select * from employee information table where work number=" & amp; Strsearchname & amp; '
"Temp="select * from employee information table where working like '%" & amp; Strsearchname & amp; "% '"