By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,238 Members | 1,518 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,238 IT Pros & Developers. It's quick & easy.

How to allow a combo box result to be left blank after using has clicked the box.

P: 29
This is just a weird nuisance that corrects itself if the user selects a value from the dropdown list, but I want to allow for the user not selecting something in the dropdown list, perhaps they look at their options but then click in a different field to start working on something else, without actually having chose something.

Ok, I have a subform (which is in datasheet view) on which are two fields fldAlbumLookup_com and fldSongsLookup_com. If an album is selected from the first field, then the second field populates with song choices only from the album selected via a query qrySongs, with the qrySongs having the criteria [Forms]![frmCommissions]![frmCommissionsSubform]![fldAlbumLookup_com].

This works great, but as I said, if they say, choose Weezer as the Album, and they click on the song field and see the song choices, which now only populate with Weezer songs, but for whatever reason they don't select a song, but instead click on another field to work on I get "The Microsoft Jet database engine cannot find a record in the table tblSongTitles with the key matching field(s) 'fldSongsLookup_com'."

I know why this is popping up. Because by not selecting something, Access isn't finding their choice among the filtered list and is producing an error, but I wish to find a way of letting Access allow them to not choose anything without producing an error.

Is there a way of letting access let them NOT choose something on a combo box filtered via query based on another combo box?

Weird question I know. Hope I have given all the information needed. Thanks for any help at all.
Mar 20 '10 #1
Share this Question
Share on Google+
3 Replies

Expert Mod 15k+
P: 31,768
I believe the control value can be set to Null. This would be equivalent to the operator using the Delete key to clear the selection.

Are you interested in doing it from the code's perspective or as the user?
Mar 20 '10 #2

P: 29
Hey NeoPa,

Good to talk to you again.

I believe from a Code's perspective. I just want to bypass any chance of someone clicking on the selection, but for whatever reason they don't choose anything, and allow them to continue on. Right now if the combo is clicked but nothing is chosen from the drop down, it leaves the box empty, but with a blinking cursor, and then if they click anything else but the box, they get the jet error cause a blank value wasn't part of the filtered drop selection.

Thank you for any help or insight.
Mar 20 '10 #3

Expert Mod 15k+
P: 31,768
Ah, That's a bit different. It seems like they have already selected something, but in this case it is invalid. Curious.

What do you have as the record source of the ComboBox, and what is an acceptable value in the field it's bound to?
Mar 21 '10 #4

Post your reply

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