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

Enabling Field based on Add New Button Click

Hi, I'd like to thank ahead for anyone who attempts to read and help. I'm really exhausting my patience on this one..

I have field named Zip and a button Add_Record. The Zip field is set to No under Enabled. So its grayed out and not allowed for edits, unless they hit click on Add_Record. Here is what I have and its compiling but not working...the Zip field continues to be grayed out...

Expand|Select|Wrap|Line Numbers
  1. Private Sub Add_Record_Click()
  2.     If Me.Add_Record = True Then
  3.     Me.Zip.Enabled = True
  4.   End If
  5. End Sub
Sep 4 '14 #1
2 1020
zmbd
5,501 Expert Mod 4TB
Look at line 2
If [add_record] is the command button, it will never be true
That is not a property of any command button.

Carefully think about the logic of the code...
Do you need that If..Then construct?
Sep 4 '14 #2
NeoPa
32,556 Expert Mod 16PB
As Z says, I think you are expecting the code to be more complicated than it need be.

Remember, if that code is even executed then Add_Record has already been clicked.
Sep 4 '14 #3

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

Similar topics

6
by: Michael Johnson Jr. | last post by:
I am trying to handle a button click event, which updates a web control table with data. The button is dynamically created in the table itself. When I call updateTable() in the Page_Load the new...
11
by: CW | last post by:
I have message entry screen that's causing me a bit of an issue. At the moment, there are 2 buttons, one is used to send message to another user (btnSend) and another is used to send messages to...
1
by: Waqas Pitafi | last post by:
Hi, 3rd day is already gone without any solution. My problem is, I have a Windows Server 2003 sp1 machine as my development platform having NTFS filesystem. Other notable components installed...
17
by: Eric | last post by:
I'm new to JavaScript and I wrote this code to play with. Oddly, if I enter text in a box and then press the button, I only get the onChange event for the text box and not the button's onclick...
7
by: =?Utf-8?B?bWFydGluMQ==?= | last post by:
Hi, All, I create button in the code ( Dim Button as new Button), not using button web component (means not drap button and drop it ont he webform), after that I try to use button_click event,...
2
by: Rajeesh123 | last post by:
I have a dom tree(same kind of treeview in .net). when user clicks on it , I pass the id to a hidden field and update it with ajax. The main page has one if clause to get the condition of hidden...
3
by: Andrew Jocelyn | last post by:
Hi I have couple of dropdown controls each with a requiredfieldvalidator. I clear the dropdownlist in the button click event. When the page is rendered the dropdown validator already flags it's...
1
by: cluless | last post by:
Hey everybody, I have a database with one major form that has a few subforms and a listbox, and on the form there are buttons that link to other forms as well. Once the list box is clicked on, the...
3
by: Jeff Karli | last post by:
I want to confirm a number was entered before allowing the click to proceed. The click does work on its own but when I add the first If statement below it does not display the message....however when...
6
by: ravikumarr | last post by:
i creating online exam system. in this application .i load the question in the load event based upon the button click values. when i am giving values through button.it displays values based on last...
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:
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
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.