473,856 Members | 1,640 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Please help me!!!!!

1 New Member
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 1193
Kevin Wilcox
68 New Member
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 Contributor
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
2331
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 my form. One to choose a directory and one to choose a picture. The script bellow works perfect without the directory choose function. I tried to make the directory choose function myself but I did not succeed. I think I made a mistake here:...
7
3634
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> </head> <style type="text/css">
4
4768
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 onto the bottom of the list (even though it keeps its record number). Also, There are certin names that i click on the list, and it will not bring it up, rather it brings to the first record (no matter how many times i try going to that...
23
3302
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 to create certain textboxes, labels, and combo boxes? Any ideas would be appreciated. Thanks
2
1676
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 choices. create a menu bar with a file that includes a perform action command and an exit command. the perform action command computes either the sum or the average of the rows or columns in the array and displays the result in a
1
1413
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, MDIParent property was populated properly). So, the FormB.MDIParent (or from within FormB, "me.MDIParent") will (should?) return an object refernce to the FormA instance (I am not sure if this is a correct assumption... please read along). At...
1
1392
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 help me out with this because this is a very serious issue for me and I need to learn more about this. And here it is again: I've been running postgres on my server for over a year now and the tables have become huge. I have 3 tables that have...
21
2001
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 group but pussyfart noise. But I realize if you are going waste your time...the most precious commodity you have, you really shouldn't be reading pussyfart messages. You might want to read a book. There's a good kid book but actually it is a...
1
1911
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
9916
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9762
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11057
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10696
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10384
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9531
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7932
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
2
4174
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3201
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.