Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 1 / December 2005

Tip: Looking for answers? Try searching our database.

Text becomes available when check mark is placed

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Linds - 15 Dec 2005 15:48 GMT
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
salad - 15 Dec 2005 15:59 GMT
> 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
Linds - 15 Dec 2005 16:07 GMT
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.
salad - 15 Dec 2005 17:10 GMT
> Thanks for the quick reply,  I will give it a try
>
[quoted text clipped - 9 lines]
> 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.
Linds - 20 Dec 2005 22:00 GMT
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?
pietlinden@hotmail.com - 20 Dec 2005 22:53 GMT
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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.