Results 1 to 9 of 9
  1. #1
    Join Date
    Apr 2002
    Posts
    21

    Unanswered: How to pass a value from form to form

    I have a form which tells the user that data is missing from certain job requests ids. I want the user to double click on the request id and have the original form open so they can fix it. I have bound textbox called Request ID field that contains the value I want passed back then matched to original form. My problem is the Request ID field on the original form is an unbound list box where the rowsource is SELECT SalesTest.[Request ID] meaning the user clicks a job in the list box and it changes the form's values. How can I do this? The form opens but the record is not matched.

    Here is my code now on the Request ID double click event:

    DoCmd.OpenForm "Dollar Stream", , "[Request Id] = """ & Me![Request ID] & """"

    The form opens but the record is not matched.

    Thanks.

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    is request id a numeric datatype?

    DoCmd.OpenForm "Dollar Stream", , "[Request Id] = " & Me![Request ID]
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Apr 2002
    Posts
    21
    Yes, it is a number.

  4. #4
    Join Date
    Apr 2002
    Posts
    21
    Bueller? Bueller?

  5. #5
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Did you use the alternate code I provided you with?

    Single quotes explicitly designate a value as a string. You need to pass a number, so you're getting a type mismatch.

    Eg:

    '1' + '1' = 11
    1 + 1 = 2
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  6. #6
    Join Date
    Apr 2002
    Posts
    21
    Sorry, I missed the code change you provided but I just tried it. Same problem - the original form opens but list box does not go to request id from the other form. It goes to the most recent request. I want the user to double click on the request id on the Data missing form and find the match on the original so they can fix the information. Since the fields are both unbound, can I match by column like below? I tried this but it does not work:

    DoCmd.OpenForm "Dollar Stream", , SalesList.Column(0) = Me.SalesList.Column(0)

    By the way, saleslist in the name of the list box on both forms. Column (0) is the request id field for both forms.

  7. #7
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    so saleslist is your listbox?

    DoCmd.OpenForm "Dollar Stream", , "[Request Id] = " & WhateverControlHoldsTheRequestIdYouWantGoesHere
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  8. #8
    Join Date
    Apr 2002
    Posts
    21
    Sorry I might be confusing you. Here is a document which visually shows what I am trying to do. Thanks.
    Attached Files Attached Files

  9. #9
    Join Date
    Apr 2002
    Posts
    21

    Can anyone help me.

    This is the last bit I need before finishing.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •