473,513 Members | 2,688 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Conditional update on a text box after onclick command from a Clickbox

10 New Member
How can i make a code if i want the following...
1.0 OnClick event, another text box will be updated with value (lets say "thescripts" If the existing value on that text box is zero (0) but if the text box has any value or content it will simply set it to zero(0).
Dec 18 '06 #1
3 1956
missinglinq
3,532 Recognized Expert Specialist
Jacko7289, you need to rephrase your posting to make your problem a little clearer.

It sounds as if when the command button is clicked, you want to check and see if your text box has a value of zero. If it does, you want its value changed to "thescripts". If it has any value other than zero, you want it changed to zero.

The logic of this aside, if the text box is bound to a field in an underlying table, you're talking about a field that is both numeric (zero) and text (thescripts) which is impossible.It can only be one or the other!

Perhaps if you could give us a clearer idea of what you're trying to accomplish we can help you.
Dec 18 '06 #2
Jacko7289
10 New Member
My apologies for being unclear...anyway, Its about my order form. This form includes a series of check box for every item and a corresponding text box for the item's price. What i basically want is that when a user selects the item (check the check box) a corresponding amount (hardcoded not from table or any other objects) will be shown on the item price text box and if the user deselects (uncheck the check box) the item price text box should show zero (0).

Hope this clarifies my inquiry. Thanks
Dec 18 '06 #3
MMcCarthy
14,534 Recognized Expert Moderator MVP
My apologies for being unclear...anyway, Its about my order form. This form includes a series of check box for every item and a corresponding text box for the item's price. What i basically want is that when a user selects the item (check the check box) a corresponding amount (hardcoded not from table or any other objects) will be shown on the item price text box and if the user deselects (uncheck the check box) the item price text box should show zero (0).

Hope this clarifies my inquiry. Thanks
In the control of the textbox for the Item Price set the default value property to 0.

Now in the after update event of the check box you will need to add the code

Expand|Select|Wrap|Line Numbers
  1. If checkbox1 Then ' defaults to true (-1)
  2.    Me.txtItemPrice = <your calculation here>
  3. Else
  4.    Me.txtItemPrice = 0
  5. End If
  6.  
Mary
Dec 19 '06 #4

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

Similar topics

13
6056
by: Andrew | last post by:
I use conditional compiler constants, set through the VBA IDE in Tools, <projectname> Properties, that I refer to throughout my code to control which code is used during development, and which during production. Usually, this only wraps code used to control quitting the whole app versus just shutting a form, but it can also control many...
4
3115
by: Bradley | last post by:
I have an A2000 database in which I have a continuous form with a tick box. There is also a text box with a conditional format that is based on the expression , if it's true then change the background colour. In A2000 it works great, but in A2003 the background doesn't always change and when it does it only changes when the record looses...
4
2716
by: gj | last post by:
Hi, I'm trying to update a sql database from a web form using text boxes. I'm trying to learn C# on my own so I am at a complete loss. I created my sql connection, data adapter, dataset and data view in the visual studio designer. I'm trying to keep a history of the record so instead of editing the record I insert a new record with my...
5
3030
by: Alastair Anderson | last post by:
I have created a very simple form with which I would like to update a single value in a single row of a database as a proof of concept. The relevant parts of the form are a DBWebTextBox (which is hooked into a column ORGANISATION.SHORT_NAME) and a Button which I am using as a submit button.
4
2134
by: Jonathan Upright | last post by:
Greetings to anyone who can help: I'm using WebMatrix to make ASP.NET pages, and I chose the "Editable DataGrid" at the project selector screen. As you may know, it defaults to the Microsoft SQL database "pubs". I've followed the instructions in the comments and also changed everything pertaining to SQL over to OLEDB. (i.e. Changed...
0
876
by: danielle.m.manning | last post by:
I have seen several tips for opening a popup window by adding an OnClick event to a button in the code behind for ASP.NET. This is ALMOST what I need. However, I only want to invoke the popup if one of five fields on my form have had their "textChanged". I have an event called Set Dirty which is below, which runs on the controls which I...
4
13107
by: midlothian | last post by:
Hello, I have conditional formatting set up on a subform based on a calculated value in the underlying query. For instance, if Sales are >$1000, the query displays "Yes," otherwise it displays "No." The conditional formatting is set up to read the 'Yes' or 'No' value and color the text accordingly. I have an event in the subform that...
2
2906
by: explode | last post by:
I made nova oledbdataadapter select update insert and delete command and connection veza. dataset is Studenti1data, I made it by the new data source wizard,and made datagridview and bindingsource draging Table1 to Form2. The select command works fine, but when I change the data and call update command I get a syntax error: ...
2
2613
by: sirdavethebrave | last post by:
Hi guys - I have written a form, and a stored procedure to update the said form. It really is as simple as that. A user can go into the form, update some fields and hit the update button to update the information which is stored in a SQL database. In testing we noticed that the form was updating correctly but the update mechanism was also...
0
7270
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7178
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7563
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7125
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...
0
5703
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...
1
5102
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4757
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...
0
3252
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...
0
3239
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.