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

Blank Combo Box hair-pulling conundrum.

45
Hi all,

I've been lurking on your site for a while now and have found numerous solutions to problems here, but I find myself in a situation where I need some advice, before I go prematurely bald. I do have a reasonably good understanding of relational databases, but I am fairly new to building them. Apologies if I miss any pertinent information.

I have a database that stores Contact's (Customers, Engineers, Suppliers) details in one table (with a [Category] field to differentiate them). In another table, I have subscription card details.

On the main Contact details form there is a combo box that allows me to allocate a subscription card to a contact. It pulls the data from a query called qryUnassignedSCards which works thus:

Expand|Select|Wrap|Line Numbers
  1. SELECT SkyCards.[Sky Card Number], SkyCards.[Ref Number], SkyCards.Engineer, SkyCards.[Sky Card ID]
  2. FROM SkyCards LEFT JOIN Contacts ON SkyCards.[Sky Card ID] = Contacts.[Sky Card ID]
  3. WHERE (((Contacts.[Sky Card ID]) Is Null))
  4. ORDER BY SkyCards.[Sky Card ID] DESC; 
The combo box on the form is Bound to SkyCards.[Sky Card ID] (In the above example column 4, but it has been moved around in troubleshooting). I have had the column width for [Sky Card ID] set to 0cm , whichever column it might be (I have tried it with a width with the same result (problem "2)" below). The field Contacts.[Sky Card ID] is also set up as a lookup to qryUnassignedSCards in the table design.

Now the problems:

1) EDIT: NOW RESOLVED The combo box displays the engineer's [Contact ID] as opposed to the name. The query results show the name: [First Name]&" "&[Last Name] presumably because that is how qryEngineers (which is the RowSource for SkyCards.[Engineer] in frmSkyCardDetails) is set up (it is bound to qryEngineers.[Contact ID]). I've not spent a lot of time trying to fix this...I'm guessing I need a name field in qryEngineers.

ContactCombo.jpg

The more pressing matter is:

2) On selecting a Sky Card the [Sky Card Number] on frmContactDetails is displayed in the combo box, exactly as I would like it to be, and the Sky Card ID is stored in the Contacts table. However, when I reload the contact's record in the form the combo box is blank, but the [Sky Card ID] has been stored.

ContactsForm.jpg

I have a similar setup in frmSkyCardDetails where an Engineer is assigned to the card. That one works perfectly and as far as I can tell is set up in exactly the same way.

After quite a few hours of frustration, I have given up. Any advice on what could be going on here would be hugely appreciated.

Thanks in advance,

Jay
Nov 6 '11 #1
7 2125
ADezii
8,834 Expert 8TB
Jay, this is one of those situations, at least for me, that is impossible to diagnose without having the DB directly in front of me. If you are willing to Convert it to Access 2003, remove any Personal Info, then I will be happy to have a look at it.
Nov 6 '11 #2
JayF
45
After some more pondering, I've realised that the combo box is blank as the Limit to List property on the combo box is set to Yes and the value is no longer in the List once it has requeried. Once it has been assigned to a customer it no longer appears in qryUnassignedSCards, which is the Row Source.

However, the Limit to List property can only be set to No if the first Visible column is also the Bound Column (for reasons that aren't clear to me). I don't want to display the bound column as this is [Sky Card ID]. I want to display the [Sky Card Number].

I also only want to display cards that have not yet been assigned to a contact, to prevent the same card being assigned to two different contacts.

I hope I'm being clear enough. My question now is: how can this be done another way?
Nov 6 '11 #3
JayF
45
Thanks ADezii. It's currently only full of Dummy Data. I'll empty most of it out to reduce the size and upload it.
Nov 6 '11 #4
JayF
45
It appears the DB was somehow corrupted. I need redo a few things before I upload a backup.
Nov 6 '11 #5
JayF
45
Attached is a zip containing both the .accdb and .mdb versions.

I think some of the functionality might have been lost in conversion, but hopefully this is good enough for you to see where I'm going wrong. It would take me literally hours to figure out why it's not 100% compatible and how correct it.

Thanks again in advance.
Attached Files
File Type: zip ContactsFinalv1.1.1.zip (2.66 MB, 61 views)
Nov 6 '11 #6
JayF
45
By the way, comments and constructive criticism from anyone who's looked at it are more than welcome. Building this has been a pretty steep learning curve. I'm sure it's probably full of bad practice and inefficiencies, but I think it's pretty functional, for a first attempt.
Nov 6 '11 #7
ADezii
8,834 Expert 8TB
@JayF:
I had a chance to take a look at your DB, and the reasons as to why the [Sky Card Number] is not being displayed, but the [Sky Card ID] is being stored, is not that obvious at first glance. I think that it has to do with the interaction between the Record Source for frmContractDetails (Contracts Extended - based on Contracts Table), and especially the Row Source of the Sky Card Combo Box (qryUnassifnedSCards) being based on a LEFT OUTER JOIN on the SkyCards Table with matching Contacts. I download an Attachment that will correctly display the Sky Card Number under all circumstances, notice the slight difference in the Row Source in that it is not joined to Contacts. When I have some time, I'll look into it further, but you will probably have found the solution by then. See Attachment.
Attached Files
File Type: zip Revised Contacts.zip (77.8 KB, 62 views)
Nov 7 '11 #8

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

Similar topics

3
by: B | last post by:
I know there are several ways to speed up combo boxes and form loading. Most of the solutions leave rowsource of the combo box blank and set the rowsource to a saved query or an SQL with a where...
2
by: c.kurutz | last post by:
Hello. I have a data entry form with several combo box fields with dlookup code in the after update procedure for the field. I am trying to add a button to copy the record on this form. I am...
6
by: Johann Blake | last post by:
I fill a table in a dataset with values that will be used by a combobox for the combobox's items. The combobox is a drop down list that only allows the user to select from the list but not enter...
9
by: Edwinah63 | last post by:
Hi everyone, Please let there be someone out there who can help. I have two BOUND combo boxes on a continuous form, the second being dependent on the first. I have no problem getting the...
0
by: mollyf | last post by:
I've got a combo box that I want to bind a collection to. I got the error "Complex Data Binding accepts as a data source either an IList or an IListSource" so I tried using the BindingSource,...
8
by: salad | last post by:
I was wondering how you handle active/inactive elements in a combo box. Let's say you have a combo box to select an employee. Joe Blow has been selected for many record however Joe has left the...
33
by: buss123 | last post by:
Hi all, combo box script code was working in IE perfectly with all modes but OnChange event was not working in FireFox(editable mode, if we select valuese that combo box values r...
4
by: Swinky | last post by:
I am trying to make a combo box dependent on a text box. I cannot get the combo box to pull the related data from the text box. I have been all over this user group & have tried several versions...
2
by: biganthony via AccessMonster.com | last post by:
Hi, I decided to install Office 2003 Service Pack 3 on my home computer to test (in full knowledge that there may be some issues with it). After installation, I have noticed that with a small...
1
by: whitbacon | last post by:
I would like to have the ability to archive values in a lookup table. Take the following example lookup table luid, label, archive 1, green, No 2, red, No 3, blue, No select * from...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.