Results 1 to 4 of 4
  1. #1
    biscuitmunchy is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2017
    Posts
    2

    Smile how to refer value from a main form into a subform.

    I'm trying to refer the data from the field "SearchResult" listbox (highlighted red) in the FRM_searchMulti into "ID" TxtBox (highlighted blue) in the "RecordsForms" Sub Form.



    My idea is to built and inventory control.. worker has to search the item in "FRM_searchmulti" form and click on " Stock in/out" command_click in main form, it will open sub form "RecordsForms" and fill all the info.


    "Frm_SearchMulti" i got this from uncle google, is to search in PartInvetory table
    "RecordsForms" i use sSQL = "SELECT to fill the info from PartInvetory table

    The problem is i want to refer the "ID" in Main form to "ID" in Sub form..
    so when worker click command_click in main form, it will open sub form and fill all the info.

    any idea


    I'm new in Access and Please someone help me.


    Click image for larger version. 

Name:	1.png 
Views:	29 
Size:	49.1 KB 
ID:	28544Click image for larger version. 

Name:	2.png 
Views:	30 
Size:	59.3 KB 
ID:	28545



    attach is my work for references, i'm afraid i'm not good in explanation.


    Thanks..
    Attached Files Attached Files

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    Open the item detail from the search form using the key in the textbox...
    doCmd.OpenForm "frmDetail",,,"[id]=" & me.txtID

  3. #3
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    The syntax can be tricky.....
    You might look at http://access.mvps.org/access/forms/frm0031.htm

  4. #4
    biscuitmunchy is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2017
    Posts
    2
    Hi ranman thanks for the answer, but i'm sorry, i do not understand your instruction. where should i put this doCmd.OpenForm "frmDetail",,,"[id]=" & me.txtID.. I'm very noob sorry

    https://wetransfer.com/downloads/dee...9080319/c2d8a2

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

Similar Threads

  1. Replies: 4
    Last Post: 11-06-2014, 05:35 AM
  2. Refer to subform name in a module
    By gg80 in forum Programming
    Replies: 11
    Last Post: 04-19-2014, 09:49 PM
  3. How to refer to fields in subforms from Main form
    By JrMontgom in forum Programming
    Replies: 1
    Last Post: 03-09-2014, 06:35 PM
  4. Refer to sub-form from main form
    By burrina in forum Access
    Replies: 3
    Last Post: 11-01-2012, 07:59 AM
  5. Refer to main form
    By terryvanduzee in forum Forms
    Replies: 3
    Last Post: 10-23-2009, 07:02 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