473,387 Members | 1,456 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Please help me!!!!!

I've been struggling for a few weeks over creating a database. I'm trying to create a way to track work orders placed and completed and who we assigned to the jobs. My biggest issue I've run into is - I can assign anywhere from 1 to 30 people on a job. I need to be able to query by individual employees and also would like to print a report showing all employees on a particular work order. When I used a multi-select list to choose my employees from - it returned only the first employee picked from the list. I can't get all the other ones to show up. And would I be able to query by employee if it was the 3rd of 4th or 25th person I assigned to the job? Any help you can give me would be greatly appreciated. Newbie here!!! Thank you
Dec 20 '07 #1
2 1175
I've been struggling for a few weeks over creating a database. I'm trying to create a way to track work orders placed and completed and who we assigned to the jobs. My biggest issue I've run into is - I can assign anywhere from 1 to 30 people on a job. I need to be able to query by individual employees and also would like to print a report showing all employees on a particular work order. When I used a multi-select list to choose my employees from - it returned only the first employee picked from the list. I can't get all the other ones to show up. And would I be able to query by employee if it was the 3rd of 4th or 25th person I assigned to the job? Any help you can give me would be greatly appreciated. Newbie here!!! Thank you
I think you have to use code to take advantage of a multi-select list, and that without this it'll only ever return the first value selected. At least, that how I use them. Typically I build a query string within the AfterUpdate event for the listbox, and then e.g. set the record source of a form or control using that string, or replace an existing query (i.e. the record source for a report) with this new definition using querydef. My AfterUpdate event would usually look something like this;

Expand|Select|Wrap|Line Numbers
  1. Dim ctl As Control
  2. Dim varItm As Variant
  3. Dim ArgCount As Long
  4. Dim MySQL As String
  5. Set ctl = Me.lstEmpID
  6. ArgCount = 0
  7.  
  8. MySQL = "Select * FROM tblEmployees WHERE"
  9.  
  10. For Each varItm In ctl.ItemsSelected
  11. If ArgCount = 0 Then
  12. MySQL = MySQL & " EmpID = & ctl.Column(0, varItm)"
  13. Else
  14. MySQL = MySQL & " OR EmpID = & ctl.Column(0, varItm)"
  15. End If
  16. ArgCount = ArgCount + 1
  17. Next varItm
  18. ‘and then use this final MySQL to create a new query or as a recordsource
HTH
Kevin
Dec 21 '07 #2
creative1
274 100+
Kevin is rite; this is the only way you can achieve this task. I also had a very bad time doing same task last week. But I tried same thing and it worked.
Good luck
Dec 21 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Lodewijk van Haringhal | last post by:
I'am new with javascritping not with programming. Is there nobody who can help me with ths simple promblem? :) Please, please give me a hint. Please help me with this script. I have two lists in...
7
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
4
by: Skully Matjas | last post by:
I am using the following code (created by the wizard) to allow to bring my form to a particular entery. But when I edit the entery (ex: put new information into a blank cell), it puts that record...
23
by: Jason | last post by:
Hi, I was wondering if any could point me to an example or give me ideas on how to dynamically create a form based on a database table? So, I would have a table designed to tell my application...
2
by: Merdelus | last post by:
I'm a new visual basic learner, I need some help with this program below: create an application that either sums or averagethe rows or columns of a two dimensional array depending on user...
1
by: Dursun | last post by:
I need to call a subroutine (CreateNewDoc()) in FormA from within FormB based on the user action in FormB. Let FormA be an MDIForm and let FormB be its MDIChild form (during the creation of FormB,...
1
by: Steve | last post by:
Hi, I've asked this question a couple of times before on this forum but no one seems to be nice enough to point me to the right direction or help me out with any information, if possible. Please...
21
by: salad | last post by:
Thanks for reading this post and wasting your time. I was thinking about writing about the PCDatasheet vs The Pussyfarts war. The pussyfarts, as near as I can tell, have little to offer this...
1
by: mtpandya | last post by:
hello i want to read variable value in .xml file so plz help me this is the code <method name="load"> <parameter name="aURI"/> <body><!]></body> </method>
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.