Coding/Array Help

  • Thread starter Thread starter Bob
  • Start date Start date
B

Bob

Hi guys, I'm kinda new to access and vbProgramming and I need your
help.
I have a table called JobAssembly which has 2 columns: JobNumbers (for
each job) and Element. Some Jobs are made of otherJobs(elements),
another word: JobNumber 000123 is made of JobNumber 000345 and 000456.
JobNumber 000456 is made of 000567 and 000678 etc.
I need a form that when the user types the main jobnumber, it goes to
the assembly table and searches for those elements for all the
elements require for that job and shows them in the form. (each
element can be a job number for another element),. I think I have to
use Arrays and some Looping but I have no idea where/how to start. Any
help would be greatly appreciated.
 
You don't need any arrays or looping code here. What you need is a query.
For example, you might have a text box called txtJobNumber and a list box
called lstElements. The row source for the list box would look something
like this:

SELECT Element FROM JobAssembly WHERE JobNumber =
Forms!NameOfYourForm!txtJobNumber

In the AfterUpdate event procedure of the text box, requery the list box:

Me!lstElements.Requery

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
Thank you for your response.
Im still having problem, this only gives me the elements for the
entered job number. some of these elements are consist of other
elements. I mean, all of these element numbers can be found in the Job
number column as well, and some of them have made of other elements
and have element number in the element column, some don't (which the
word "none" is displayed instead of element number). I'm trying to use
more listboxes for sub elements using your method to display all to
the last element.
Thanks again for your help
 
Sorry, Bob, I'm afraid I didn't understand that.

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
Back
Top