-
Hello all. I'll try to boil this all down and see if I can ask a good question.
I have a form with 10 text boxes. The user inputs an employee ID number in each box. On the next form, I would like to show the ID number as well as the corresponding employee name and vehicle (for all 10 inputs). What is the best way to handle this?
I am getting a little better at the whole bound controls process. But, I think this might dive into queries, and I'm on thin ground there. I am using a simple Access DB that only has the 3 fields, IDNumber, Name, and Vehicle. This is a small program for work that will show the daily roster for the employees. My employer dumped this on me along with a copy of VB Enterprise (gotta love that). However, the help disk is nowhere to be found, and my books don't seem to really cover it.
Thanks for the help.
[This message has been edited by Trick (edited 01-30-2000).]
-
Why use another form? Place the fields you want on your first form and set the ones you don't want to display, initially, to be invisible (visible attribute to false).
-
Thanks for the response!
Well, my first question was simplified so that I could get it to make sense. Unfortunately, there is too much information on the first form. There are a couple other things going on in the form that I was able to handle. I just couldn't get this whole thing on one form. And it wouldn't make sense if I took some things off the form to make room. A design constraint you could say...
What I'm thinking, is taking the 10 IDNumbers into an array, placing them on the second form, and then doing the DB search from there. That's really where I'm stuck. I guess what I need is to be able to tell the form to get the first array variable, search the DB, then print the fields. Do this through the length of the array for each index.
If that all seems to be right, then my question is: How do I do that search with the array variable? Is it SQL? If so, I'll hit the books some more and see if I can flesh it out.
Thanks again.
-
Hi,
This is a long shot but maybe it's just what you're looking for: use a data control with a recordset filled by an SQL, something like:
Code:
set data1.recordset = db.Openrecordset( _
"SELECT * FROM tablename " _
"WHERE driverID = textbox1.text " _
"OR driverID = textbox2.text " _
"OR driverID = textbox3.text " _
...and so on, up to
"OR driverID = textbox10.text ")
and use a bound DBgrid to display.
(or is this too simplistic?)
-
Thanks for the response Pardede. I'll look at that and give it a try.
Trick