maxmangion
AWF VIP
- Local time
- Today, 10:19
- Joined
- Feb 26, 2003
- Messages
- 2,805
i have a Search button on a form which uses the "find what" dialog box of MS Access. By default Access adds the following line:
Screen.PreviousControl.SetFocus
Now instead of that line i am creating an input box which asks the user to type in the field name he wants to search in and then set the focus on that field.
e.g.
InputBox("Which field would you like to search" & vbcrlf & "Author" & vbcrlf & "email", "Searching")
Now in this manner i have to make the above statement:
if inputbox.... = "Author" then
Author.SetFocus
else
Email.SetFocus
end if
the above method is fine for a few fields, but if the if i would have about 20 fields it would be really tedious doing it in the above method.
is there a way that i can read the input from the input box and then set the userinput.setfocus?
thank you
Screen.PreviousControl.SetFocus
Now instead of that line i am creating an input box which asks the user to type in the field name he wants to search in and then set the focus on that field.
e.g.
InputBox("Which field would you like to search" & vbcrlf & "Author" & vbcrlf & "email", "Searching")
Now in this manner i have to make the above statement:
if inputbox.... = "Author" then
Author.SetFocus
else
Email.SetFocus
end if
the above method is fine for a few fields, but if the if i would have about 20 fields it would be really tedious doing it in the above method.
is there a way that i can read the input from the input box and then set the userinput.setfocus?
thank you