Results 1 to 8 of 8
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Newbury, Berkshire, England
    Posts
    712
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Pass string to form from module (A2K)

    I want to pass a string to a form from a module. At the moment I am successfully passing it to the Tag property, and I have also done it with Openargs. However I wondered if it was possible to pass the string to a variable in the forms module? I have tried without success.

    This is the code I currently use:::

    Public Sub fOpenfrmAddAcc()
    DoCmd.OpenForm "frmAddAddr"


    Dim strNewRecord As String
    strNewRecord = "SELECT * FROM tblAddress WHERE AddrType = 8"

    With Form_frmAddAddr

    .RecordSource = strNewRecord
    .Tag = strNewRecord
    .Caption = "Account Customers"
    .lblHeading.Caption = "Account Customers"
    .AllowAdditions = True
    .AllowEdits = True
    .DataEntry = False
    .NavigationButtons = True
    'DoCmd.MoveSize 1000, 500
    End With
    End Sub

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Pass string to form from module (A2K)

    Hi Rupert,

    What's wrong with the OpenArgs ?

    You could also do it with a global variable, I never had problems with global variables, but I know that Charlotte is not very enthusiast about using them as they can loose there contents.
    Francois

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Newbury, Berkshire, England
    Posts
    712
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Pass string to form from module (A2K)

    Well that was what I was worried about really. I feel that using either OpenArgs and the Tag for this sort of thing was not right, in the sense that they are workarounds, or short cuts and I thought if Charlotte ever found out, I

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Pass string to form from module (A2K)

    What? Am I frightening the Loungers now? Me?? <img src=/S/granny.gif border=0 alt=granny width=20 height=20> <img src=/S/evilgrin.gif border=0 alt=evilgrin width=15 height=15>

    Rupert, OpenArgs and Tags are *meant* for this kind of thing. They aren't workarounds at all.

    ... Now I think I'll go terrorize another board for a while! <img src=/S/cauldron.gif border=0 alt=cauldron width=20 height=20> <img src=/S/witch.gif border=0 alt=witch width=15 height=15>
    Charlotte

  5. #5
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Newbury, Berkshire, England
    Posts
    712
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Pass string to form from module (A2K)

    Thanks for that Charlotte.
    I couldn

  6. #6
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Pass string to form from module (A2K)

    Probably some people that are specialist in making puns in the scuttlebutt forum <img src=/S/yum.gif border=0 alt=yum width=15 height=15>
    Francois

  7. #7
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Pass string to form from module (A2K)

    <img src=/S/rofl.gif border=0 alt=rofl width=15 height=15> <img src=/S/rofl.gif border=0 alt=rofl width=15 height=15> You've got it! That's where the punsters wind up ... in the soup! <img src=/S/laugh.gif border=0 alt=laugh width=15 height=15>
    Charlotte

  8. #8
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Pass string to form from module (A2K)

    Ah - but the soup gives us nourishment, and we keep multiplying, mulitplying, multiplying . . . <img src=/S/yadda.gif border=0 alt=yadda width=15 height=15> <img src=/S/yadda.gif border=0 alt=yadda width=15 height=15> <img src=/S/yadda.gif border=0 alt=yadda width=15 height=15>
    Wendell

Posting Permissions

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