S
SamT
I can't seem to get my form to work. It is designed to search my DB for a
record where the key field is provided by the user.
I have a table that is listing employees. The key field is their NT login id
(as it will be different for every user.) As such, it would be easiest for my
users to be able to type in the NT login of the person in question and click
a button to pull up their record.
To accomplish this, I have created a form that I have named "Search Form"
and on this form, I have displayed all of the pertinent fields from my
primary table. I also have an unbound text box labeled "SearchControl"
I have a button next to the Search Control text box that is coded as follows:
Private Sub Command5_Click()
Me.Filter = "NT = " & Me.SearchControl
Me.FilterOn = TRUE
Me.Requery
End Sub
"NT" is the name of the existing field from my primary table that contains
employee's nt login ids. By my logic, what I have written is saying the
following:
"When someone clicks this button, set the filter of the form to NT = (what's
in the text box) and filter the form. You should now see the person whose NT
login you searched for."
Is that in fact what I have written? I am really just learning as I go along
here in Access, so any help would be appreciated.
record where the key field is provided by the user.
I have a table that is listing employees. The key field is their NT login id
(as it will be different for every user.) As such, it would be easiest for my
users to be able to type in the NT login of the person in question and click
a button to pull up their record.
To accomplish this, I have created a form that I have named "Search Form"
and on this form, I have displayed all of the pertinent fields from my
primary table. I also have an unbound text box labeled "SearchControl"
I have a button next to the Search Control text box that is coded as follows:
Private Sub Command5_Click()
Me.Filter = "NT = " & Me.SearchControl
Me.FilterOn = TRUE
Me.Requery
End Sub
"NT" is the name of the existing field from my primary table that contains
employee's nt login ids. By my logic, what I have written is saying the
following:
"When someone clicks this button, set the filter of the form to NT = (what's
in the text box) and filter the form. You should now see the person whose NT
login you searched for."
Is that in fact what I have written? I am really just learning as I go along
here in Access, so any help would be appreciated.