Results 1 to 11 of 11
  1. #1
    Join Date
    Mar 2004
    Location
    Greenville, SC
    Posts
    271

    Unanswered: help building a search page/sheet/field whatever I need?

    What event proceedure can I use or code I can write to do a search then open a form with that record?

    I want to be able to have a combobox. (Something like an InputBox in Excel)
    Enter something like "CAT". Click it then;
    Have it show a list of all companys from the form TblBillTo table with CAT in them.
    CATALYTICA
    CATERPILLAR
    MONCATCO
    COOL CAT KENNELS

    Then I want to be able to click on the word and it will open my form called FrmRequestForWO and enter
    this record of the company name I just clicked.

    Am i asking for the impossible?
    Any help is greatly appreciated,
    If I need to give more information, let me know!!
    Michael
    Gotta to do some code

  2. #2
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Use a filter in the OpenForm command.

    Something like OpenForm "Formname",,,, "Fieldname Like '*CAT*'"

    That example is not perfect, but it should point you in the right direction
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    or use the filter by example form........

  4. #4
    Join Date
    Mar 2004
    Location
    Greenville, SC
    Posts
    271
    ok,
    Let me explain clearer.
    Actually I have figured out on my search form how to get the "CAT" solution!!!!
    2nd step I need help on is...

    I have a Form called "FrmSearch"
    The FrmSearch Form has let's say 4 results on the page.
    I want to click the results I want. Let's call this "strSearchData" (This result is from a table "TblBillTo")
    After I click one of the choices, i would like a Form called "FrmRequestForWO" to open and the strSearchData would be entered in the "BillToId" field on FrmRequestForWO. And then close the FrmSearch.

    Does this make more sense?
    Michael
    Gotta to do some code

  5. #5
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    OpenForm the FrmRequestForWO.
    forms!FrmRequestForWO!BillTo = me.IDFieldOnFrmSearch
    Close FrmSearch
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  6. #6
    Join Date
    Mar 2004
    Location
    Greenville, SC
    Posts
    271
    The problem I have I get an error
    Error 2113

    Here is what I have:

    Code:
    Private Sub Form_Load()
        Dim lngID As Long
        If IsNull(Me.OpenArgs) Then Exit Sub
        lngID = CLng(Me.OpenArgs)
        BillToID.Value = lngID
        DoCmd.Close acForm, "frmSearch"
        
    End Sub

    Ideas?
    Michael
    Gotta to do some code

  7. #7
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    What is error 2113?

    I think you access OpenArgs in the Form_Open, not Form_Load.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  8. #8
    Join Date
    Mar 2004
    Location
    Greenville, SC
    Posts
    271
    Runtime Error 2113

    The value you entered isn't valid for this field.
    I tried it in Open and Load, No luck!

    It may have something to do with the BillToID on the RequestForWO form? This is an ID number field (even though it shows text) and text is transfering over.

    Michael
    Gotta to do some code

  9. #9
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Well that field, what is it's data type? Long Integer? Is it an Autonumber field?

    If it's showing text, I can't see how it can be a numeric field.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  10. #10
    Join Date
    Mar 2004
    Location
    Greenville, SC
    Posts
    271
    Ok,
    Just for the fun of it, I tried to send the openargs to a text box.
    It went through and did not give an error but locked up????

    I think access just doesn't want me sending data across forms.

    Michael
    Gotta to do some code

  11. #11
    Join Date
    Sep 2006
    Posts
    265
    Perhaps try setting the default value on the FrmRequestForWO Form rather than the value.

    No need to close the FrmSearch unless you want to , but if you do close it last.

    Simon

Posting Permissions

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