[AccessD] Need help with a combobox issue

DWUTKA at marlow.com DWUTKA at marlow.com
Tue Jan 18 17:28:19 CST 2005


LOL.  Well, I make sure to put Hoffa in charge of my Union querries...every
so often I just have to make him disappear....

Drew

-----Original Message-----
From: Hale, Jim [mailto:Jim.Hale at fleetpride.com]
Sent: Tuesday, January 18, 2005 2:45 PM
To: 'Access Developers discussion and problem solving'
Subject: RE: [AccessD] Need help with a combobox issue


You need to watch out for those Union queries. They tend to run slower and
slower until they quit working unless you provide them with more resources.
Right-to-work queries are much better. ;-)
Jim Hale

-----Original Message-----
From: DWUTKA at marlow.com [mailto:DWUTKA at marlow.com]
Sent: Tuesday, January 18, 2005 11:42 AM
To: accessd at databaseadvisors.com
Subject: RE: [AccessD] Need help with a combobox issue


Glad to help.  Gotta love those UNION querries, they make life soooo much
easier!

Drew

-----Original Message-----
From: Joe Rojas [mailto:JRojas at tnco-inc.com]
Sent: Tuesday, January 18, 2005 11:23 AM
To: 'Access Developers discussion and problem solving'
Subject: RE: [AccessD] Need help with a combobox issue


Thanks for the help Drew!
This worked out perfectly.

-----Original Message-----
From: DWUTKA at marlow.com [mailto:DWUTKA at marlow.com]
Sent: Monday, January 17, 2005 1:41 PM
To: accessd at databaseadvisors.com
Subject: RE: [AccessD] Need help with a combobox issue

Turn the SQL for the combo box into a Union Query.  Like this:

SELECT EmployeeID, EmployeeName FROM tblEmployees WHERE
CurrentlyEmployed=True

UNION SELECT EmployeeID, EmployeeName FROM tblEmployees WHERE
EmployeeID=Forms![frmTempData]![EmployeeNumber]

That way, the top SELECT displays all normal employees, and the bottom
select includes the one possible employee that may not meet the criteria in
the top SQL.  To fully implement, however, you will need to requery the
combo box in the OnCurrent event of the form, so that as you move from one
record to another, the 'current' employee is added to the combo as
applicable.  This will temporarily put the employee into the combobox's list
for that record.

Drew

-----Original Message-----
From: Joe Rojas [mailto:JRojas at tnco-inc.com]
Sent: Monday, January 17, 2005 12:12 PM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] Need help with a combobox issue


Hi All,

I have a combobox that is bound to a field. The field stores the employee
number that is associated with the current record. The data for the combobox
is pulled from a table and the combobox is set to limit to list. The list is
made up of two columns, one for the employee number (bound column) and
another to display the employee's name. The employee number column is set to
0" so that only the employees name is visible. Because employees come and
go, I have added the ability to edit which employees are shown in the
combobox list. This allows the addition and removal of new and old employees
respectively.

At the time a record is created the associated employee would have been in
the combobox list because they would be an active employee. Some time after
the creation of this record the employee may leave the company and would be
remove from the list of the combobox but the record would still reference
the terminated employee. If someone were to go back and look at this record,
it would display nothing because the employee is not in the list. I added
some code that checks to see if the Text property of the combobox is an
empty string and if so look up the name of the terminated employee and set
the combobox's Text property accordingly. The problem with this is that it
generates a NotInList error and you are forced to undo the change in order
to move on.

Any ideas on how to work around this. I would like to keep the ability to
modify the list of active employees so that users do not waste time weeding
through old employees while allowing the combobox to display the employee
name of someone who is no longer with the company.

Any help will be greatly appreciated!

Thanks
JR



This electronic transmission is strictly confidential to TNCO, Inc. and
intended solely for the addressee. It may contain information which is
covered by legal, professional, or other privileges. If you are not the
intended addressee, or someone authorized by the intended addressee to
receive transmissions on behalf of the addressee, you must not retain,
disclose in any form, copy, or take any action in reliance on this
transmission. If you have received this transmission in error, please notify
the sender as soon as possible and destroy this message. While TNCO, Inc.
uses virus protection, the recipient should check this email and any
attachments for the presence of viruses. TNCO, Inc. accepts no liability for
any damage caused by any virus transmitted by this email.
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



This electronic transmission is strictly confidential to TNCO, Inc. and
intended solely for the addressee. It may contain information which is
covered by legal, professional, or other privileges. If you are not the
intended addressee, or someone authorized by the intended addressee to
receive transmissions on behalf of the addressee, you must not retain,
disclose in any form, copy, or take any action in reliance on this
transmission. If you have received this transmission in error, please notify
the sender as soon as possible and destroy this message. While TNCO, Inc.
uses virus protection, the recipient should check this email and any
attachments for the presence of viruses. TNCO, Inc. accepts no liability for
any damage caused by any virus transmitted by this email.
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

***********************************************************************
The information transmitted is intended solely for the individual or
entity to which it is addressed and may contain confidential and/or
privileged material. Any review, retransmission, dissemination or
other use of or taking action in reliance upon this information by
persons or entities other than the intended recipient is prohibited.
If you have received this email in error please contact the sender and
delete the material from any computer. As a recipient of this email,
you are responsible for screening its contents and the contents of any
attachments for the presence of viruses. No liability is accepted for
any damages caused by any virus transmitted by this email.



More information about the AccessD mailing list