Results 1 to 5 of 5
  1. #1
    newtocoding is offline Novice
    Windows 8 Access 2013 32bit
    Join Date
    May 2017
    Posts
    3

    From on click button makes a field visible on another form

    Hi there

    When I press a button on one form, I want it to open another form but make a field on that form visible. I have tried the following:

    Private Sub Command2_Click()
    Me.text1.Visible = True
    End Sub

    But it will say method or data member not found.

    Any help much appreicated.

    Thanks

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    use the FULL path to the other form

    forms!my2ndForm!txtBox.visible = true

    (me.XXX ME = the form the code is running in)

  3. #3
    newtocoding is offline Novice
    Windows 8 Access 2013 32bit
    Join Date
    May 2017
    Posts
    3
    Thanks Ranman

    But still does not work, Says runtime error: 2450 and cannot find the referenced form?

  4. #4
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    You need to first open the form before you can reference any of its objects.
    DoCmd.OpenForm "formname"
    Forms!text1.Visible=True

  5. #5
    newtocoding is offline Novice
    Windows 8 Access 2013 32bit
    Join Date
    May 2017
    Posts
    3
    Thank you Aytee111

    That works perfectly!

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

Similar Threads

  1. Replies: 2
    Last Post: 01-09-2017, 04:56 PM
  2. Replies: 1
    Last Post: 03-21-2016, 10:40 AM
  3. Replies: 4
    Last Post: 11-04-2014, 07:35 PM
  4. Replies: 2
    Last Post: 02-08-2014, 07:10 PM
  5. Replies: 1
    Last Post: 02-20-2012, 01:59 PM

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