Results 1 to 7 of 7

Thread: How to Auto Populate fields from sub form to form?

  1. #1
    Join Date
    Oct 2010
    Posts
    62

    How to Auto Populate fields from sub form to form?

    I have a sub form which shows WO# and hull#. I would akin to for those fields to colonize while the user opens up a form that necessitates them, after clicking on the hull#. Therefore, I setup the hull# field to unlock From Job Accomplished on click. After that when From Job Accomplished releases, I would like for hull# and WO# to be occupied from sub form. Make intelligence? At the moment, I went appearing around and saw a number of codes for comparable actions, but unluckily I did not appreciate or understand. Now if there is any way to get this complete through the UI rather than SQL, it would be easier on me. If not, I will require little bit of help.

  2. #2
    Join Date
    May 2008
    Posts
    3,316

    Re: How to Auto Populate fields from sub form to form?

    There are a number of techniques for accomplished this. One technique is to bypass the values of these 2 Fields in OpenArgs:
    DoCmd.OpenForm "FromJobAccomplished", acNormal, , , acFormEdit, acWindowNormal, "<hull#>,<WO#>"
    To plug them into the suitable Fields:
    1. Private Sub Form_Activate()
    2. Me![txthull#] = Left(Me.OpenArgs, InStr(Me.OpenArgs, ",") - 1)
    3. Me![txtWO#] = Right(Me.OpenArgs, Len(Me.OpenArgs) - InStr(Me.OpenArgs, ","))
    4. End Sub

    You could as well position the 2 Fields in the Sub-Form straight I mean directly.

  3. #3
    Join Date
    Jan 2008
    Posts
    3,755

    Re: How to Auto Populate fields from sub form to form?

    I also have the same problem and I see your post here. This code I would create it as a macro all the way through the UI in the Macro Design? As well, the first code I sort a get. However, the second code "Me!" and "OpenArgs" are not recognizable or well known to me. If you can assist me recognize that, and then I can form out what the code is doing. One more thing, the sub form displays the 12 most fresh or recent records. So, if I list the fields straightly, I have to make certain that the one which is inhabits is the one the user clicked.

  4. #4
    Join Date
    Apr 2008
    Posts
    2,139

    Re: How to Auto Populate fields from sub form to form?

    I also want to say something in this case. However I know, this code is not in a Macro but it is the VBA code contained within the Click() Event of a Command Button. I refer to the recent occurrence of code implementation, which, in your exacting case is the active Form. OpenArgs is purely an Argument to the OpenForm() Method which permits data or information to be approved to the Form which will be opened.

  5. #5
    Join Date
    Apr 2008
    Posts
    4,088

    Re: How to Auto Populate fields from sub form to form?

    In this case just tried out the following some steps:
    1. Release the form in Design View.
    2. Choose the Command Button to setup.
    3. Press Alt-Enter for View Properties.
    4. Go to the On Click property.
    5. Choose Event Procedure from Drop Down.
    6. Click on Ellipsis to open VBA window.

    You are at present in the extremely custom within the VBA code viewer window.

  6. #6
    Join Date
    Aug 2006
    Posts
    181

    Re: How to Auto Populate fields from sub form to form?

    I would like to auto settle fields in a form by selecting one value from a table and containing the equivalent data filled in based on Library tables I have created. I have been victorious in building auto lookup queries but don’t know how to reflect this in a form. I am not knowledgeable with Visual Basic. I meaning I have played around in it but have not been successful. If I have a few directions I am sure I could plug in the correct fields to correspond with my data.
    QTechnology Ultra-Quiet ATX PSU 460W I MSI K8N Neo4-F I AMD Opteron 144 CABNE0545 2.66Ghz I 2 x 512MB RAM I 380GB Maxtor SATAI Raid0 Hard Drive I 40GB Maxtor IDE Hard Drive I Nvidia GeForce 7900GTX I Win XP Home Service Pack 2 I Soundblaster Xtreme Fidelity Fatal1ty I Mercury Home Theater HT-4500

  7. #7
    Join Date
    Aug 2006
    Posts
    209

    Re: How to Auto Populate fields from sub form to form?

    I assume this is what you are looking for. Try this one: Open or release your form in design view, and open the properties. Allocate the query to the Record Source of the form. Now while you insert controls, such as textboxes, combo boxes, etc. to the form, you open the properties for those controls, and choose and click on the Control Source. You will have a directory or list of every field for the query. Choose one. Close and save the form. Is this what you are looking for?
    Blessings to you

Similar Threads

  1. Replies: 2
    Last Post: 02-05-2011, 07:06 AM
  2. Some fields appers blank in Adobe form
    By Gimelstob in forum Windows Software
    Replies: 7
    Last Post: 29-06-2010, 02:02 AM
  3. How to clear browser form fields
    By Rover in forum Software Development
    Replies: 3
    Last Post: 29-08-2009, 09:26 AM
  4. Form fields become yellow in Firefox
    By Caiden in forum Technology & Internet
    Replies: 3
    Last Post: 29-07-2009, 12:00 AM
  5. How to populate a merged cell from a form in excel
    By SoConfused in forum Windows Software
    Replies: 1
    Last Post: 09-06-2009, 08:35 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,298,968.53927 seconds with 17 queries