Results 1 to 5 of 5
  1. #1
    rivereridanus is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jun 2011
    Posts
    71

    make fields visible onclick() button

    Hello,

    I am struggling with some vba coding in access 2007.

    I have a form which has 4 fields for inputting items directly into a table. I also have a button called Command122 which I want users to be able to click to display 4 more (invisible) input fields.

    When I click the button, I get the error "Method or Data Not Found". Could someone help me with my code?

    Private Sub Command122_Click()
    Me.Label18.Visible = True
    Me.Label19.Visible = True
    Me.Label20.Visible = True
    Me.Label21.Visible = True
    Me.object5.Visible = True


    Me.object6.Visible = True
    Me.object7.Visible = True
    Me.object8.Visible = True
    End Sub
    Last edited by rivereridanus; 06-28-2011 at 08:22 AM. Reason: Solved

  2. #2
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Just a quick note for you (as your edit appears that you solved the problem) but make sure to give your controls MEANINGFUL names. Using names like Command122 or object5, unless you absolutely need to have that naming for iterating through them for some reason, is not good. The reason is that it becomes a real pain later on down the road (even 6 months to a year for you) when you have to go back to things and then you (or someone who comes after you) needs to figure out what is what instead of being able to look at the code and say, "OH! There's the name field." Or something like that.

  3. #3
    rivereridanus is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jun 2011
    Posts
    71
    Yeah, you're right. I didn't bother to do that since this is the only instance of vba coding that I was doing in this db, but I will be sure to be careful of that.

    I appreciate your help!

  4. #4
    syed faraz is offline Novice
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3
    Hi
    I am also facing the same issue : make fields visible onclick() button. I am trying to make visible the fields when i press add command. Please help me with this.

    Thanks
    Syed

  5. #5
    syed faraz is offline Novice
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3
    Hi Bob,

    Could you please tell me the solution of the below request i.e.below. I am also facing the similar issue.

    ---------------------------------------------------------
    I am struggling with some vba coding in access 2007.

    I have a form which has 4 fields for inputting items directly into a table. I also have a button called Command122 which I want users to be able to click to display 4 more (invisible) input fields.

    When I click the button, I get the error "Method or Data Not Found". Could someone help me with my code?

    Private Sub Command122_Click()
    Me.Label18.Visible = True
    Me.Label19.Visible = True
    Me.Label20.Visible = True
    Me.Label21.Visible = True
    Me.object5.Visible = True
    Me.object6.Visible = True
    Me.object7.Visible = True
    Me.object8.Visible = True
    End Sub

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Change Value using Button OnClick
    By nchesebro in forum Programming
    Replies: 1
    Last Post: 06-23-2011, 02:47 AM
  2. Replies: 2
    Last Post: 01-06-2011, 04:38 AM
  3. Replies: 10
    Last Post: 12-31-2010, 12:35 PM
  4. Replies: 1
    Last Post: 09-27-2010, 04:27 AM
  5. Report showing non-visible fields
    By AKQTS in forum Forms
    Replies: 2
    Last Post: 09-21-2010, 09:40 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums