473,756 Members | 1,842 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cmd Button enabled based on combo box

I am really struggling to get to grips with this issue, would grateful
for any advice.

I have a form 'Applicant_Pers on' with various student contact data.
There is a combo box to 2 options of either 'Enquiry' or 'Application'.
If 'Enquiry' is chosen then cmd button 'Interviews' needs to be
disabled.
If 'Application' is chosen then cmb button 'Interviews needs to be
enabled.

I have managed to get this to work via a macro on the 'On Exit' of the
combo box. However this only works if the inputter is creating a new
record or changes the combo on an existing record.

What I need to happen is that when the 'Applicant_Pers on' form is first
opended populated with a students data, the cmd button is
enabled/disabled dependant on what is in the combo box at that time.

If I put the code into the 'on open' of the form, this would only work
when the form first opened.

I am really stuck and as you can probably tell I have limited
experience.
Many thanks
Carl

Aug 17 '06 #1
1 2201
On 17 Aug 2006 08:15:30 -0700, zack wrote:
I am really struggling to get to grips with this issue, would grateful
for any advice.

I have a form 'Applicant_Pers on' with various student contact data.
There is a combo box to 2 options of either 'Enquiry' or 'Application'.
If 'Enquiry' is chosen then cmd button 'Interviews' needs to be
disabled.
If 'Application' is chosen then cmb button 'Interviews needs to be
enabled.

I have managed to get this to work via a macro on the 'On Exit' of the
combo box. However this only works if the inputter is creating a new
record or changes the combo on an existing record.

What I need to happen is that when the 'Applicant_Pers on' form is first
opended populated with a students data, the cmd button is
enabled/disabled dependant on what is in the combo box at that time.

If I put the code into the 'on open' of the form, this would only work
when the form first opened.

I am really stuck and as you can probably tell I have limited
experience.
Many thanks
Carl
Use the Combo Box AfterUpdate event, qs well as the Form's Current
event.
On the Combo box's AfterUpdate event line, write
[Event Procedure]
Then click on the little button with 3 dots that appears on that line.
When the code window opens, the cursor will be flashing between 2
already existing lines of code. Between those 2 lines write:
Me![Interviews].Enabled = Me![ComboName] = "Enquiry"
Save the changes.
Then do the same thing on the form's Current event, using the same
code line.

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Aug 17 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2628
by: Arif Çimen | last post by:
Hi to everybody, I have chnged a button text in design mode. But After compiling and executing the program the text of the button do not change to new value. Any Ideas? Thaks for helps.
14
1930
by: Steve Chatham | last post by:
I have a combo box that gets populated with a group of items based on a sql table. I had in mind that I'd insert a value at the beginning of that combo box, that'd say "No Item Selected" and that when the selected index property was changed, to automatically populate a datagrid below that combo box based on the item selected. As an alternative, if the user wanted to see everything (a customer list), I wanted to put a radio button...
0
1308
by: Brian Campbell | last post by:
I have some code that may be of some help to us newbies. It is for when you have a form with say two radio buttons, each activating/focusing its respective combo box and making its initial value null. Note the "fra" indicating all is within a frame. Note also in radio button properties they have a value that sets the case numbers below. Select Case Me.fraThisFrame.Value Case 1 With Me.cboFirstOne .Enabled = True
14
4972
by: Kevin | last post by:
A couple of easy questions here hopefully. I've been working on two different database projects which make use of multiple forms. 1. Where's the best/recommended placement for command buttons for things like delete, save, edit, cancel buttons - in the footer, or on the form detail section? 2. If in the footer, how do you add them to the tab order?
4
1382
by: =?Utf-8?B?cm9kY2hhcg==?= | last post by:
hey all, i have an edit button on my web page. what is the quickest or best way to link the Enabled property of the button on the aspx page to the User's Table Permissions if it has been granted update permissions? thanks, rodchar
1
1371
by: Ron | last post by:
Hi all, I've got a combo box control (cboYoMomma) on a main form (frmMain) that I want to enable only if a subform (sfrmSubForm) does not have any records in it. But, once there are records in the subform I want to un-enable that combo list so it can't be changed. And, if all the records on the subform are removed, I want to re-enable that combo box control. Is that possible? And if so, how?
4
2490
by: seangibson | last post by:
Is there a way to change the appearance of my form based on which option button is selected? I am using a form to input data into a table of transactions. There are basically 3 types of transactions (the type of which I would specify with an options button) and, though they all share common fields, some entries do not require all of the fields to be populated. For these I'd like for some of the combo boxes (my form uses combo boxes...
4
2990
by: Whasigga | last post by:
Hi I've created a form that has 7 subforms. It is the same subform, bound to a table, just repeated. This form represents a week, and each subform is used to enter in data for each day of the week. The main form has a combo box that must have a value selected before anything else can happen. Once that value is selected, the 7 subforms are enabled, and also one of the fields is populated with the value from the main form. These subforms also...
5
11824
by: andersond | last post by:
I need to enable or disable a submit button based on the value of a data field stored in a database. I have found working examples of how to enable or disable based on a checkbox; but, I need it to work based on a data field value. I have created a textbox in a hidden area that contains the stored data value. I have set the beginning value of the submit button to disabled. I want the submit button to be enabled if the value in the textbox is...
0
10034
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9843
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9713
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8713
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6534
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5142
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3805
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3358
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.