H
h.a. collins
Hello All,
I have a fairly simple Access 2000 DB with one table (Telephone--about
700 entries) and one form (Telephone Details).
So that I have the option of searching by phone number, I've created a
command button linked to a text box. This allows me to enter the phone
number, hit the button, and I go directly to that single record. This
seems to work fine (see VB code at end of message, if you're curious)
and is quite useful.
However, I'm realizing that I do not always want to use this search
command button, and would like to have another command button (or
macro) that will allow me to "see all records", so that I can either
scroll using the arrow keys or Filter by form. Since the command
button isn't a filter, the only way I can "see all records" again is
by closing out the form, and re-opening. This is a bit of a nuisance!
Any ideas, suggestions?
Thanks in advance for your insight~
heather
________________________________________
Private Sub cmdSearch_Click()
If IsNull(PhoneSearch) Then
MsgBox "Please enter your search criterion", vbExclamation
Else
PhoneSearch.SetFocus
RecordSource = "SELECT * FROM Telephone WHERE Telephone_1 = '"
& PhoneSearch.Text & "';"
End If
End Sub
________________________________________
I have a fairly simple Access 2000 DB with one table (Telephone--about
700 entries) and one form (Telephone Details).
So that I have the option of searching by phone number, I've created a
command button linked to a text box. This allows me to enter the phone
number, hit the button, and I go directly to that single record. This
seems to work fine (see VB code at end of message, if you're curious)
and is quite useful.
However, I'm realizing that I do not always want to use this search
command button, and would like to have another command button (or
macro) that will allow me to "see all records", so that I can either
scroll using the arrow keys or Filter by form. Since the command
button isn't a filter, the only way I can "see all records" again is
by closing out the form, and re-opening. This is a bit of a nuisance!
Any ideas, suggestions?
Thanks in advance for your insight~
heather
________________________________________
Private Sub cmdSearch_Click()
If IsNull(PhoneSearch) Then
MsgBox "Please enter your search criterion", vbExclamation
Else
PhoneSearch.SetFocus
RecordSource = "SELECT * FROM Telephone WHERE Telephone_1 = '"
& PhoneSearch.Text & "';"
End If
End Sub
________________________________________