Results 1 to 9 of 9

Thread: Parameters

  1. #1
    Join Date
    Mar 2004
    Posts
    27

    Wink Unanswered: Parameters

    Hello There...

    How do I pass parameters between forms?
    I want to pass a code for this next form for every new row it creates,


    Can you help me?

    TKS
    Atha
    20175337

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713

    Re: Parameters

    Originally posted by atha
    Hello There...

    How do I pass parameters between forms?
    I want to pass a code for this next form for every new row it creates,


    Can you help me?

    TKS
    Access version?

    OpenArgs parameter of the OpenForm method ...

  3. #3
    Join Date
    Mar 2004
    Posts
    27

    Re: Parameters

    2000. Access 2000.
    I just want that my field on this new form receives the code from it's field on the prior form.

    Tks
    Atha
    20175337

  4. #4
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713

    Re: Parameters

    Originally posted by atha
    2000. Access 2000.
    I just want that my field on this new form receives the code from it's field on the prior form.

    Tks
    Question answered then ...

  5. #5
    Join Date
    Mar 2004
    Posts
    27

    Question Re: Parameters

    some of it, yes...
    but now I am using a command that is not working.

    n_code = Forms!Inventory.OpenArgs
    If Len(n_code) > 0 Then
    DoCmd.GoToControl "cpu_id"
    DoCmd.FinderRecord n_code, true, , true, , true
    End if

    All that I want is that 'cpu_id' from that Inventory form is brought to the new form, history.

    Tks
    Atha
    20175337

  6. #6
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    if both forms will be open, you can avoid (ugly) openargs and read the value directly.

    aTextBoxOnCurrentform = forms!theOtherFormName.theTextBoxName

    and repeat for any number of other boxes etc

    this could sit happily in the Form_Load() event
    if you don't want to keep "theOtherFormName" open, you can close it in the _Load() also once you have sucked the data you want from it.

    izy
    currently using SS 2008R2

  7. #7
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Originally posted by izyrider
    if both forms will be open, you can avoid (ugly) openargs and read the value directly.

    aTextBoxOnCurrentform = forms!theOtherFormName.theTextBoxName

    and repeat for any number of other boxes etc

    this could sit happily in the Form_Load() event
    if you don't want to keep "theOtherFormName" open, you can close it in the _Load() also once you have sucked the data you want from it.

    izy
    Well I think that the OpenArgs is beautious ... Of course being an ol' C++ programmer passing parameters is old hat ... And I don't have to rely upon a parent form being active to invoke another form ... So, is the glass half full or half empty?

  8. #8
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    well, openargs is something i just don't use:

    lots of forms is something else i dont use any more, so there is no issue about keeping forms open. my frmMain is always open.

    my current habit is that everything sits in a frmMain with appropriate .sourceobject changes on subforms as the user moves about his business. if i need some data (e.g. an ID) to be shared amongst several .sourceobject then frmMain is there to handle it (as a non-editable displayed value or a selectable combo).

    add a few popups to the mix for searches, date selection, etc. and that's how my apps go.

    i'm one of the few people in the world that never got past page 6 of Kernighan & Ritchie ...the "hello, world" bit. i can well understand that fanatics of { and } scattered randomly on the screen would like openargs. sadly i am not included in that set.

    have a happy evening - it's time for me to grab some telly (...and maybe that glass will be more than half-full). take a look at the mass mailing one if you have a moment - it needs some fresh blood.

    izy
    currently using SS 2008R2

  9. #9
    Join Date
    Mar 2004
    Posts
    27

    Re: Parameters

    tks a lot, worked
    Atha
    20175337

Posting Permissions

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