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

Disable a Combo Box

PhilOfWalton
1,430 Expert 1GB
I gave a Continuous Subform with a Combo box Cbo1 and a CheckBox Chk1

Both are bound controls. The DoubleClick on the Combo box changes the record.

If Chk1 is set to False, I want the Combo box to work in the normal way.

If Chk1 is set to True, I want to stop the Combo box displaying anything other than the data already showing. (In other words - No Dropdown)

If I lock the ComboBox, it prevents the data changing.
If using Conditional Formatting I use the Enabled = false, it stops the "Drop down" working which is what I want, but also but prevents the Double click from working.

Is there a way round this dichotomy?

Thanks

Phil
Oct 18 '18 #1
5 2642
NeoPa
32,554 Expert Mod 16PB
I'm confused. What ConditionalFormatting is setting What to False, and why?

Isn't the solution simply to use a standard click on the CheckBox to toggle between ComboBox locked and unlocked.
Oct 19 '18 #2
PhilOfWalton
1,430 Expert 1GB
Not to worry, as I have found a solution (Bodge, but it's pretty good)


I have "exploded" the form, and the little dropdown symbol is a command button with a picture drawn on it. In practice these sit exactly over the corresponding controls.
Both "InputTable"s use the same DoublClick routine
On the OnCurrent of the form, I alter the visibility and show either the combo box or the (text box and command button), depending on the Chk1 check box.

To answer your query, one of the Conditional formatting options is to enable a field (badly worded in the Conditional Formatting dialog box as when selected, the field is disabled.

Phil
Attached Images
File Type: png Bodge.png (10.5 KB, 817 views)
Oct 19 '18 #3
NeoPa
32,554 Expert Mod 16PB
Hi Phil.

I often get the impression that you like to climb past all the easy / simple answers before you arrive at a complicated one you're happy with. I'd like to help more, but at the end of the day you must go with what you're happiest with.

Best wishes my friend :-)
Oct 19 '18 #4
PhilOfWalton
1,430 Expert 1GB
You could well be right, but I simplified the problem too much.

The Chk1 I mentioned actually is set by whether the table in in a relationship with other tables, and as such, it is disabled.

In this case the Combo Box provides the linking field.

If it is set to false it is just a field in a table.

If you have a look at Post 13 (a bit out of date) inhttps://bytes.com/topic/access/answe...lised-database

you may get a better of where everything fits.

Thanks as ever for your input, sorry about the over-simplification.

Phil
Oct 19 '18 #5
NeoPa
32,554 Expert Mod 16PB
Phil, it's absolutely fine. I just sometimes find myself smiling ;-) All is good :-)
Oct 19 '18 #6

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

Similar topics

1
by: TheThrill | last post by:
I'm trying to develop a few combo boxes. When a user selects a choice in Combo box "A" they have the choices "1, 2, 3, 4". Say they pick 3. They must then go to combo box "B" and when they pick 3...
5
by: Cillies | last post by:
Hi All, This message is a continuation of an earlier post, so please accept my apologies as I believe I would get a better response this way. Problem: I have 4 combo boxes which I want to...
3
by: MervinJadhav | last post by:
How to disable combo items? Mervin Jadhav Software Developer Solutiioneyes Pvt Ltd (http://www.solutiioneyes.com) 203, Sai Chambers, 16 Mumbai-Pune Rd, Pune - 411 003 INDIA
4
by: festerian | last post by:
Hi everybody - I'm a new access user and would appreciate some help. I'm trying to create a form, on which I'm trying to disable/enable a combo box, based on the value entered in another combo box...
2
by: ARC | last post by:
I'm testing a user's db that contains a very large number of records. I have an invoice screen, with an invoice select dropdown box that shows all invoices, and the customer's name, etc. With...
11
Hiren Joshi
by: Hiren Joshi | last post by:
Hello All Experts, I am a Moderate VB Programmer. I am developing one Application at the moment with VB 6.0 and MS Access. Operating System is Win XP. Its a Multi User application. What I want...
2
by: y2ktan | last post by:
Hi Guys and Girls, I am building a windows application using VS2005, C#.net. Now, I have a combo box that contains a collection of elements. Thus, I want to grey out some of the elements in the...
2
by: prokopis | last post by:
am using c# for windows application and i need some help. i have a combo box that is connected with the database and retreive the data from a table in the database.this tha i need is if is possible...
5
by: aquarius4u | last post by:
I m new to MS ACCESS and just started the VBA coding part, i have created a basic form with couple of combo boxes, just wants to know how to disable the combo box for the previous saved records.. coz...
1
by: ajju1987 | last post by:
Hii I fetched value from database and attach to combobox.. further from the option selected i displayed certain values in the grid.. I want if a user select any value from combobox then I want...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.