hi,
this is the code im trying to use for my search button. Just to explain on the toolbar i select search, an input box should pop up, i input the firstname on a staff then the listbox should clear and show the details. all my code does is just clear the listbox.
Search
[code=vb]
Set dbmyDB = OpenDatabase("E :\skol\A2 Computing\Speed y Pizza database.mdb")
Set rsmyRS = dbmyDB.OpenReco rdset("Staff", dbOpenDynaset)
Dim Name As String
Name = InputBox("Pleas e insert name", "Name")
If Not rsmyRS.EOF Then rsmyRS.MoveFirs t
lstRecord.Clear
Do While Not rsmyRS.EOF
If LCase(rsmyRS!Fi rstname) = LCase(Name) Then
lstRecord.AddIt em rsmyRS!Firstnam e & " " & rsmyRS!Lastname & vbTab & rsmyRS!StaffID
End If
rsmyRS.MoveNext
Loop
[/code]
CAN SOMEONE PLEASE HELP
this is the code im trying to use for my search button. Just to explain on the toolbar i select search, an input box should pop up, i input the firstname on a staff then the listbox should clear and show the details. all my code does is just clear the listbox.
Search
[code=vb]
Set dbmyDB = OpenDatabase("E :\skol\A2 Computing\Speed y Pizza database.mdb")
Set rsmyRS = dbmyDB.OpenReco rdset("Staff", dbOpenDynaset)
Dim Name As String
Name = InputBox("Pleas e insert name", "Name")
If Not rsmyRS.EOF Then rsmyRS.MoveFirs t
lstRecord.Clear
Do While Not rsmyRS.EOF
If LCase(rsmyRS!Fi rstname) = LCase(Name) Then
lstRecord.AddIt em rsmyRS!Firstnam e & " " & rsmyRS!Lastname & vbTab & rsmyRS!StaffID
End If
rsmyRS.MoveNext
Loop
[/code]
CAN SOMEONE PLEASE HELP
Comment