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

Text becomes available when check mark is placed

When a customer has made a down payment I would like to be able to have
check box that when checked opens another text box that displays
today's date and lock it in.

Where would I go about telling a text box to only be available if
another check box is checked. Thanks, Lindsey

Dec 15 '05 #1
5 2791
Linds wrote:
When a customer has made a down payment I would like to be able to have
check box that when checked opens another text box that displays
today's date and lock it in.

Where would I go about telling a text box to only be available if
another check box is checked. Thanks, Lindsey

Let's say your checkbox is called Check1 and the text box is called
Text1. Let's further assume you want the text box to be visible or
Enabled/Locked can enter data or Enabled/Locked can't enter data. In
the checkbox's AfterUpdate event, enter something like.
If ILikeVisible then
'make it visible or hidden
Me.Text1.Visible = Me.Check1
Else
'enable or disable field
Me.Text1.Enabled = Me.Check1
Me.Text1.Locked = (Not Me.Check1)
Endif

If Me.Check1 then
Me.Text1 = Date
Else
'this clears the date. Not sure how you want to handle
'if it was checked and later on you uncheck it.
Me.Text1 = Null
Endif
Dec 15 '05 #2
Thanks for the quick reply, I will give it a try

I was hoping I could make a simple database without using VBA, Not
that I am unwilling to learn, but I am not far along and I am already
shown the benefit of using VBA. I really don't want to always be
bothering everyone on here with how to this and how to that,

Does anybody know of a good beginners tutorial to using VBA. Of course
I like free stuff but if you all know of a good beginners guide that
costs I would love to hear your review.

Oh and I do appreciate you helping me with the check box, I haven't
tried it yet but it looks simple enough.

Dec 15 '05 #3
Linds wrote:
Thanks for the quick reply, I will give it a try

I was hoping I could make a simple database without using VBA, Not
that I am unwilling to learn, but I am not far along and I am already
shown the benefit of using VBA. I really don't want to always be
bothering everyone on here with how to this and how to that,

Does anybody know of a good beginners tutorial to using VBA. Of course
I like free stuff but if you all know of a good beginners guide that
costs I would love to hear your review.

Oh and I do appreciate you helping me with the check box, I haven't
tried it yet but it looks simple enough.

I suggest the MS Step-By-Step book on Access. To gain ANY benefit you
need to actually do the exercises. You won't be a world-class
programmer at the end but you'll have the basics and can expand on it.

Actually, one of the best sources you'll get to VBA and Access is this
newsgroup. I suggest reading as much as you can here. The best people
in the business stop off here and help others.

If you want, you can also start creating macros. Once a macro has been
created, you can convert the macro to code. That might be a good
learning tool also.

Look at sites like http://www.mvps.org/access or Tony Toews site at
http://www.granite.ab.ca/accsmstr.htm or Allen Brownes site at
http://allenbrowne.com/tips.html or Albert Kallals site at
http://www.members.shaw.ca/AlbertKallal/ for starters.

Dec 15 '05 #4
Salad, Lets say my check box is called Down Payment with a space and
my text box is called DP Date also with a space. How do I insert those
names into the script. It says that there was an unexpected end?

Dec 20 '05 #5
you can use Me.Controls("Down Payment").Property

or you can rename your the controls on your form. Doing so has no
bearing on the control source (the field bound to the control). IOW,
you could rename them all taking all the spaces out and adding control
type prefixes, like cboPaymentType or txtMyTextBox. This makes life
easier when you want to work with controls in code because you don't
have to add extra characters like square brackets around objects with
spaces in their names.

Instead of
Forms!My Form!My Control Name ' a really BAD example because "Form"
and "Control" and "Name" are all reserved words in VBA

use
Forms![My Form]![My Control Name]

I'm just using a really bad example to make the syntax clearer.

Dec 20 '05 #6

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

Similar topics

3
by: Mark | last post by:
I have a website with an increasing amount of articles and news reports and so I am thinking of moving away from storing each article as a seperate page to having a single page and storing articles...
13
by: MLH | last post by:
I have a form with two controls: !! - combo box !! - text box A button on the form tries to run this SQL when clicked... INSERT INTO BodyMsgsSent (ToWhom, BodyText) SELECT DISTINCTROW !! AS...
7
by: Mark | last post by:
Hi All, I have a report which is based on a query which is used to produce QC check sheets. I have quite a few text boxes which are used to display questions depending on the value of one...
2
by: Mark | last post by:
Hi all, I have a DAL which takes in a value as shown below ready for my MSSQL stored procedure. protected SqlDecimal _annualLeave = SqlDecimal.Null; public SqlDecimal AnnualLeave { get...
9
by: Erwin Moller | last post by:
Hi, Can anybody comment on this? In comp.lang.php I advised somebody to skip using: <script language="javascript"> and use: <script type="text/javascript"> And mr. Dunlop gave this response:
5
by: cyprian | last post by:
how do i use javascript function to dynamically insert text into textarea from the result of an array comparison expression. read the dom but found no way out. thanks
9
by: =?Utf-8?B?QnJpYW4gQ29vaw==?= | last post by:
I want to open a text file and format it into a specific line and then apply color to a specific location of the text and then display it in a RichTextBox after all of this is done. I can do all...
2
by: stainless | last post by:
I have a date selection field that can be blank OR set to a valid future date. I am thinking of using a datepicker field but have one issue with this. If I have a check box in the datepicker...
1
by: littlealex | last post by:
IE6 not displaying text correctly - IE 7 & Firefox 3 are fine! Need some help with this as fairly new to CSS! In IE6 the text for the following page doesn't display properly - rather than being...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
1
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...
0
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...
0
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,...
0
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...
0
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...

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.