Results 1 to 4 of 4
  1. #1
    Playerpawn is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    11

    Please assist on this task. I'm stuck.

    Please, please help if you know what I need to do. I need to get this done and I'm stuck.

    I'll explain what I have, then what I'm trying to do.



    A form (frm_start) with two controls, an editable field that's unbound (text_input) and an OK button (control_ok). Also, I have a query (qry_start) that wants 1 input (user_input) and will return 1 row, 3 columns from a table.

    What I want to do is, the user starts at the form (frm_start) and inputs a value into the (text_input) then clicks OK (control_ok), at this point, it takes that value supplied and passes it into (qry_start) as the (user_input) arguement that's required, then the returned 3 columns of data is opens another form (frm_ending) and passes those 3 columns of data into that form as arguements so I can have the newly opened form do things based on those.

    In example, user inputs "Magic1" and clicks okay, the query gets ran suppling "Magic1" as the required user input, this query will return 3 columns of data (1 row) which will now open another form passing these 3 values into the new form as arguements. The 'new form' uses these arguements to fill in existing boxes and to format properly.

    I hope anyone who took time to read this can help. I don't know Access functions/syntax well enough to code this.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2007
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,622
    Passing fields to a form, not sure what this is about. Bind the second form to the table or query the record will come from then supply the user input as filter criteria for the form in the OpenForm method. Like:
    DoCmd.OpenForm "form name", , , "field name ='" & Me.inputboxname & "'"

    The values in the three fields are available for code behind the second form. What is it you want to do with them?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Playerpawn is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    11
    To clarify what I'm trying to do,

    On the first form there's one editable textbox for the user to enter the name of an item. In my example, this is "Magic1". When they click OK, I need to code it so "Magic1" is supplied to qry_start which looks something like:

    SELECT part_name, part_type, part_codes
    FROM part_master
    WHERE part_name = (USER INPUT HERE)

    So now that they clicked OK, and this query returned probably:

    MAGIC1, MAGIC_STUFF, 12

    I want to pass these 3 values as arguements into another opening form. This new opening form is used to log stuff about the item.

    Therefore, the new form will open and using these 3 values I will code it so:

    MAGIC1 is used to auto populate a part_name field
    MAGIC_TYPE is used to auto populate a part_type field
    12 (part_codes) is used to format the form. For example, the form may have 5 fields for logging information but due to part_code 12 I will hide the 3rd one because it doesn't apply.

    So ultimately, I have 2 forms, one query.

    First form is where a part is entered, runs the query, then opens the actual logging form with arguements supplied from the query to doctor the form accordingly.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2007
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,622
    Use DLookup or SELECT sql in VBA code or bind forms/reports to query to retrieve values.

    Sounds like duplication of data (the part_type value). With properly related tables and form/subform arrangements, this should not be necessary and much simpler.

    However, if you must, then instead of feeding value to query, combine all this into one form. Form opens to new record, user enters criteria, DLookup expression in textboxes or in VBA retrieve the related values, code saves values and formats form (controls are not visible until criteria entered and triggers code to make appropriate controls visible).
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Testing Task - Forms
    By collwill in forum Access
    Replies: 1
    Last Post: 03-09-2011, 10:25 PM
  2. Update Outlook task from Access
    By timg147 in forum Programming
    Replies: 1
    Last Post: 08-16-2010, 12:27 PM
  3. Add task from Access to Outlook
    By Johan in forum Programming
    Replies: 1
    Last Post: 03-31-2010, 09:58 AM
  4. any way to schedule a compress/repaor task?
    By Coolpapabell in forum Access
    Replies: 7
    Last Post: 10-07-2009, 02:08 PM
  5. **I need Help with EXCEL. Please Assist**
    By n in forum Import/Export Data
    Replies: 0
    Last Post: 06-23-2006, 10:08 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