473,378 Members | 1,680 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,378 software developers and data experts.

Info Disappears from query-bound Combo Box

110 100+
Hello all -

I have a combo box (cboEmployee) on a form for service visits. The combo box record source is a query and only displays active employees. The control is bound to the employee number, but displays the employee last name. (i.e. column widths 0";1") The Limit to List property is set to Yes (and I get a message that it must stay set to yes unless I change the column widths).

The user is then able to select an employee from the combo box. However, when an employee is no longer active, (no longer shows up in the query), he/she also disappears from past service visits he/she may have completed. If I change the column widths to 1";1", the employee number will show up - but it seems there is no way to still display the Employee Name.

Is there a way to still display the employee names if they have been removed from the query? (i.e. I want to view all, but still restrict users to only select active employees.)

Thanks in advance for any insight.
Jun 27 '10 #1

✓ answered by dgunner71

Just as an update to this problem, I did find the issue.

The control source of the combobox was based on an SQL statement that required the status to be active.

Expand|Select|Wrap|Line Numbers
  1. ControlSource = SELECT [ID], [txtValue], [ynActive] FROM tbl WHERE [ynActive] = -1;
Bound Column = 1
Column Count= 3
Column Widths = 0;1.25;.5

My problem was I stored value 5 (i.e. [ID]=5) in a record and later marked value 5 not active ([ynActive] = 0). The stored value of the combobox was still 5, however the combobox itself appeared blank because the SQL statement was preventing the value from appearing.

I had to add an Or statement to the SQL clause to specify either the value is active OR the value matches the [ID] of the form.

Gunner

2 1605
jimatqsi
1,271 Expert 1GB
No, because you have bound a data item in the record set to the combo box that you are using to search/recall employees. I have found this to be a bad idea, so I don't do it any longer.

The best thing is to make your combo box unbound to the form's record set. After an employee is selected in the combo box, go run a little bit of code to advance the record set to the selected employee. I suppose you can then display a message if the selected employee is not active or whatever keeps him/her from being in the record set.

Jim
Jun 28 '10 #2
dgunner71
110 100+
Just as an update to this problem, I did find the issue.

The control source of the combobox was based on an SQL statement that required the status to be active.

Expand|Select|Wrap|Line Numbers
  1. ControlSource = SELECT [ID], [txtValue], [ynActive] FROM tbl WHERE [ynActive] = -1;
Bound Column = 1
Column Count= 3
Column Widths = 0;1.25;.5

My problem was I stored value 5 (i.e. [ID]=5) in a record and later marked value 5 not active ([ynActive] = 0). The stored value of the combobox was still 5, however the combobox itself appeared blank because the SQL statement was preventing the value from appearing.

I had to add an Or statement to the SQL clause to specify either the value is active OR the value matches the [ID] of the form.

Gunner
Dec 1 '13 #3

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

Similar topics

4
by: starman7 | last post by:
I have a query that seems to kill the db for our website (causes the 'Too many connections' error). I would like to avoid this! Is there a way to test the query before the db goes down? I do not...
17
by: Lapchien | last post by:
My table has a record called date/time - filled (not surprisingly) with a date and time. I can format the date in one query field, also the time, using format in an expression. My user wants me...
2
by: Sukkel | last post by:
When I define relations in the Backend of my Database, everything works fine. I get these funny lines (with 1 and "OO") between the fields of the different table that indicate a one to many...
9
by: Mike Bridge | last post by:
I am using MS Access 2003, and I typed in a query in SQL view which was working fine. Now when I open it, it gives me the error "Join expression not supported". Apparently, Access "fixed" it for...
2
by: Brad | last post by:
I'm extracting info for users and group in our domain using directoryservices. This is working well except I have one more piece I need to finish which I'm stuck on. I need to (a) query the info...
10
by: Suzi | last post by:
I am creating a windows app and I use the data adapter wizard to generate a SQL query. Once the data adapter is created, I generate a dataset from it and my dataset appears in the designer. Then I...
10
by: pcnerd | last post by:
I've created a demo program that draws random lines on the form. At the end, a messagebox pops up with the words"I'm done!". When I click on "OK", the messagebox disappears, but a white square is...
168
by: broeisi | last post by:
Hello, Is there a way in C to get information at runtime if a processor is 32 or 64 bit? Cheers, Broeisi
17
by: cmartin1986 | last post by:
Ok I this one will be tough to explain so i'll try to give as much detail as possible. What i need to do is build a stacked column chart in access off a set of information that has 13 different...
4
by: Bartcom2000 | last post by:
Ok guys and gals, I work in a firm that uses several ms access dbs to reconcile data for multiple accounts. Problem is that many people have acces to the database window. inevitably individuals...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.