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 / New Users / April 2004

Tip: Looking for answers? Try searching our database.

Set Visible Property

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jenny - 15 Apr 2004 20:11 GMT
Hi Everyon

Is it possible to set a label property to visible if a condition is met from a record in another table

The Form/Table is called FollowUp it has an invisible label that you can see in a design mode called CallBac

When a Check Box is ticked, the form/table is called Review,  I want the label to be visible. I a
trying to use the expression builder to see how it should happen then copy the code into the on update propert
of my form but I am not having any success. Can anybody help

TI
PC Datasheet - 15 Apr 2004 21:45 GMT
You need to use something like:

If DLookup(**Fill in the blanks**) Then
   MyLabel.Visible = True
End If

You can lookup the DLookup function in the Help file.

--
                                        PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
                             resource@pcdatasheet.com
                                www.pcdatasheet.com

> Hi Everyone
>
[quoted text clipped - 7 lines]
>
> TIA
Jenny - 16 Apr 2004 05:26 GMT
Thanks for the response

I have tried both methods and help files with no succes
the code I am attempting to get to work is looking like this::

Private Sub Form_Open(Cancel As Integer)    
    If DLookup (Review.Chk = Yes) The
    Me.CallBack.Visible = Tru
End If
End Su

I can set visible dependent on a result in the same form but not from another tabl

Help please what I am doing wron

TI
Duane Hookom - 16 Apr 2004 05:59 GMT
Apparently you didn't  lookup the DLookup function in the Help file. I can
only guess your DLookup() might be

   If DLookup ("Chk","Review") = Yes Then
This assumes there is only one record in the Review table and the Chk field
is a yes/no field.

Signature

Duane Hookom
MS Access MVP

> Thanks for the responses
>
[quoted text clipped - 12 lines]
>
> TIA
Jenny - 16 Apr 2004 07:06 GMT
Sorry to be an idiot

I did look at the help file in Access and followed the conventions for DLookup
but I still keep getting the error variable not defined

If DLookup ("Chk","Review") = Yes Then
Me.CallBack.Visible = True

or

If DLookup("[Chk]", "Review") = Yes
 Me.CallBack.Visible = True

If there is more than 1 field in the Review table does the code alter ?

Thank you for your patience
Duane Hookom - 16 Apr 2004 13:22 GMT
DLookup() expects the first argument to be a field or expression, the second
is a table or select query. There is an optional third argument used to
filter the table or query to one or more records. For instance:
DLookup("empFirstName & ' ' & empLastName", "tblEmployees", "EmpID=3")

Signature

Duane Hookom
MS Access MVP

> Sorry to be an idiot
>
[quoted text clipped - 12 lines]
>
> Thank you for your patience
PC Datasheet - 16 Apr 2004 15:28 GMT
Duane,

You certainly have a lot of patience!!

Steve
PC Datasheet

> DLookup() expects the first argument to be a field or expression, the second
> is a table or select query. There is an optional third argument used to
[quoted text clipped - 22 lines]
> >
> > Thank you for your patience
Rick - 15 Apr 2004 22:26 GMT
Hi Jenny

Be forewarned that I'm a new user, so take this information as such.

I was able to get a label on my form to change visible properties with this code.  My form is defaulted to AllowEdits = False.  I have this code placed in a listbox's GotFocus event so that when a user clicks into the listbox the code runs. Of course, you would have to change object names to fit your project and select your own event.  (BTW, in my experimentations, I could not get this to work in the form's AfterUpdate, Dirty, or DataChange events.

Private Sub lboJobActivity_GotFocus(
   Me.AllowEdits = Tru
   Me.lblWorkedInFactory.Visible = Fals
   If Me.cboActivityTypeID = 3 Then Me.lblWorkedInFactory.Visible = Tru
End Su

Hope this is helpful to you

Rick..
   
    ----- Jenny wrote: ----
   
    Hi Everyon
   
    Is it possible to set a label property to visible if a condition is met from a record in another table
   
    The Form/Table is called FollowUp it has an invisible label that you can see in a design mode called CallBac
   
    When a Check Box is ticked, the form/table is called Review,  I want the label to be visible. I a
    trying to use the expression builder to see how it should happen then copy the code into the on update propert
    of my form but I am not having any success. Can anybody help
   
    TI
 
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.