Results 1 to 5 of 5
  1. #1
    aamer is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Location
    Pakistan
    Posts
    276

    Show Result From Subform To Main Form In Text Box


    Have Subform "Admin_Purchase_Subform" on this subform have a button "EditBtn" with a code


    Private Sub EditBtn_Click()


    Me.AllowEdits = True
    Me.AllowDeletions = False
    Me.Kaption = "EDIT MODE !!!"


    End Sub


    If I Clik On "EditBtn" the textbox "Kaption" on Subform "Admin_Purchase_Subform" it shows EDIT MODE !!!


    but I want this textbox "Kaption"on Main Form "Admin_Purchase_Payments_Main_Form" how can I do that, it shows the EDIT MODE !!! on the Main Form.

  2. #2
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,424
    Me refers to the form that the code is behind. Try Me.Parent.Kaption = "EDIT MODE !!!"
    That assumes there is a control by that name on the main form.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    aamer is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Location
    Pakistan
    Posts
    276
    Have another issue needs help
    this time am accessing from main form "Admin Purchase" to subform "Purchase Subform"
    the button is placed on main form


    the code i tried to execute is the following. but its not working


    Private Sub NewEntryBtn_Click()
    Me.Form.[Purchase Subform]!NewEntryBtn = DoCmd.GoToRecord , "", acNewRec
    End Sub

  4. #4
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,158
    That syntax is completely incorrect. Press compile and it will tell you, you can't just randomly string commands you think might work together.
    What are you trying to do - go to a new record on the sub form?

    Something like
    Code:
    Private Sub NewEntryBtn_Click()
    
         DoCmd.GoToRecord acDataForm, [COLOR=var(--highlight-variable)]"Purchase Subform"[/COLOR], acNewRecEnd Sub
    Might work, assuming the form names are correct.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  5. #5
    aamer is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Location
    Pakistan
    Posts
    276
    Quote Originally Posted by Minty View Post
    That syntax is completely incorrect. Press compile and it will tell you, you can't just randomly string commands you think might work together.
    Quote Originally Posted by Minty View Post
    What are you trying to do - go to a new record on the sub form?

    Something like
    Code:
    Private Sub NewEntryBtn_Click()
    
        DoCmd.GoToRecord acDataForm, [COLOR=var(--highlight-variable)]"Purchase Subform"[/COLOR], acNewRecEnd Sub
    Might work, assuming the form names are correct.



    Yes am trying to go to New record from "Admin Purchase" to "Purchase Subform".
    your suggested following code did not work.


    DoCmd.GoToRecord acDataForm, "Purchase Subform", acNewRec

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

Similar Threads

  1. Replies: 5
    Last Post: 10-18-2017, 09:36 AM
  2. Replies: 3
    Last Post: 01-19-2017, 05:05 AM
  3. Filter subform from text box on main form
    By ittechguy in forum Macros
    Replies: 5
    Last Post: 09-21-2015, 10:55 PM
  4. Replies: 19
    Last Post: 06-30-2014, 04:36 PM
  5. Replies: 4
    Last Post: 04-03-2014, 08:03 AM

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