StillLearningAccess
New Member
- Joined
- Oct 24, 2010
- Messages
- 3
I hope that I do not make this sound confusing. What I have created currently works but I would like to improve it.
I have created 2 tables Table 1 and a Table 2, In Table 1 is only one
field "Last Name" and is a text field. Table 2 is a populated database with information and one of the fields is also called
"Last Name". I created a form using the table with the single field "Last Name" in it I created an unbound text box.
and from a query I created (using table 2 all the data I wanted to show on my subform) once the text box has a name typed in the blank
text box on the form it matchs the database and displays any information that matchs the input of the text box. form1 and the subform are links by the last name field.
I can type a name into the empty text box and hit enter, it searches table 2 and displays the results in the subform below.
My question/problem is that when a name is typed in which is not in the database it just sits there (the form). I would like
to create a message box that displays a message There is no matching data please try again. This message box
should have an OK button to return back to the original form. Is this possible? I know very little about programing
VBA but am willing to learn I just do not know where to look. Do I create a message box and link it to the text box, the search button or the subform since it looks through all the data to find results? any help will be greatly appreciated.
Robert
I have created 2 tables Table 1 and a Table 2, In Table 1 is only one
field "Last Name" and is a text field. Table 2 is a populated database with information and one of the fields is also called
"Last Name". I created a form using the table with the single field "Last Name" in it I created an unbound text box.
and from a query I created (using table 2 all the data I wanted to show on my subform) once the text box has a name typed in the blank
text box on the form it matchs the database and displays any information that matchs the input of the text box. form1 and the subform are links by the last name field.
I can type a name into the empty text box and hit enter, it searches table 2 and displays the results in the subform below.
My question/problem is that when a name is typed in which is not in the database it just sits there (the form). I would like
to create a message box that displays a message There is no matching data please try again. This message box
should have an OK button to return back to the original form. Is this possible? I know very little about programing
VBA but am willing to learn I just do not know where to look. Do I create a message box and link it to the text box, the search button or the subform since it looks through all the data to find results? any help will be greatly appreciated.
Robert