Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2004
    Posts
    44

    Unanswered: Hiding Subform and Joint to Report

    I am currently have problems hiding any of my subforms, based on a combo box choice. The following is what I have:

    If Me.[ComboBoxName] = 1 Then
    SubForm![FormName]![SubFormName].visable = False
    End If

    I'm not really sure why this is not working. However, after endering this, and attempting to use the form, I recieve a '2465' Run-Time Error, stating that it's can't find the field ComboBoxName. Now this is confusing me greratly, since I have no idea why it is refercing a field. I have tried other items, but I believe I recieved a similar problem when I tried to use "If Form![FormName].[ComboBoxName] = 1 Then"

    Also, I currently have this under the "OnOpen" event for the main form. Should it instead be imbeded somewhere in the Events for the ComboBox?

    Also, I already have the combo box set up corretly so that they are populated. However, when I try and run my report the field are filled with #Error instead of the values that are represented on the main form.

    Thanks in advance!

    David

  2. #2
    Join Date
    Aug 2003
    Location
    Argentina
    Posts
    465
    Prube thid:
    If Me![ComboBoxName] = 1 Then <-------- !!
    SubForm![FormName]![SubFormName].visible= False <------------
    End If
    or
    If Form![FormName]![ComboBoxName] = 1 Then
    SubForm![FormName]![SubFormName].visible= False <------------
    End If
    Saludos
    Norberto

  3. #3
    Join Date
    Jan 2004
    Posts
    44
    Well, neither of those seemed to work. However, the following appeard to work:
    Private Sub Form_Open(Cancel As Integer)

    If Me![ProgramNumbers] = 1 Then
    Me![07].Visible = False

    Yet, when I now try to get to form to appear, after selecting 7, the following will not work:

    Private Sub ProgramNumbers_Change()

    If Me![ProgramNumbers] >= 7 Then
    Me![07].Visable = True
    End If

    With that I am getting:
    "Error: Object doesn't support this property or method"

    It could simply be that I have the code under the wrong event, but I'm not sure. I would think it would be the same except for the >= and True instead of false.

    Thanks in advance.

    David

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •