Kamis, 07 September 2017

Re: [MS_AccessPros] Refer to a checkbox on another form.

 

Art-

The first one that your have commented out is correct, but the error message tells the tale.  It thinks your frmMain is open in Design view.  Is it?

John Viescas, author
Effective SQL
SQL Queries for Mere Mortals
Microsoft Office Access 2010 Inside Out
Microsoft Office Access 2007 Inside Out
Building Access Applications

On Sep 8, 2017, at 06:24, dbalorenzini@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

Have a form called frmMain which contain a check box control called checkModify. I also have a form called frmNewEditECabinet where in the Load event I need to check the state of checkModify on frmMain. I have tried the following, see the commented out lines:


Private Sub Form_Load()
'  If Forms!frmMain!checkModify.Value = True Then   'modify an eCabinet
'   If Forms("frmMain").checkModify.Value = True Then
   If Forms!frmMain.Form!checkModify.Value = True Then
   'If Forms![frmMain]![checkModify].Value = True Then
'   If ([Forms]![frmMain]![checkModify].Value = True) Then
  
  
  
    Me.cmbCurrentECabinet.Visible = True
        Me.txtFields11.Visible = False
        Me.cmdAddeIndex.Default = True
        Me.cmdAddeSubfolder.Enabled = False
        Me.lblSelectECabinet.Visible = True
        Me.cmdRenameECabinet.Visible = True
        Me.cmdDeleteECabinet.Visible = True
        Me.Caption = "Modify Existing eCabinet"
    Else                                  ' Creating a new eCabinet
        Me.cmdDone.Enabled = False
        initializeECabinetKey = False
        Me.lsteSubFolder.Enabled = False
        Me.cmdAddeSubfolder.Enabled = False
        cmdAdvancedOptions.Enabled = False
        cmdRefreshFrm.Enabled = False
        Me.cmdCancel.Visible = True
        Me.cmbCurrentECabinet.Visible = False
        Me.txtFields11.Visible = True
        Me.cmdSave.Visible = True
        Me.lblCabinetName.Visible = True
        Me.Caption = "Create New eCabinet"
    End If
End Sub


I get to kinds of errors given which If statement I try: 1. Property is not available in design mode. 2. THe expression you entered has a field, control, or property name that Microsoft Access can't find.


I know I can't be too far off...


Thank you,


Art Lorenzini

SD



__._,_.___

Posted by: John Viescas <johnv@msn.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


.

__,_._,___

Tidak ada komentar:

Posting Komentar