Results 1 to 7 of 7
  1. #1
    New Lounger
    Join Date
    Sep 2002
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    recordsets (2000)

    Hello,

    I posted a question on VBA recently and was told this might be a better place. However, the VBA guys did give me something that looks like it will do everything I need! Problem: I can't get part of it to work. I won't even go into the nature of the larger problem, I just want help with part of the possible solution.

    I'll shoot straight with you. I am not an Access programmer (but my boss thinks that because I can use one Delphi/Paradox I can use VBA/Access). I do not have the option of turning the project down. I know that what I need to do is possible (and probably simple), but I am totally clueless. My machine doesn't have all the help files included so I'm SOL there. <img src=/S/brickwall.gif border=0 alt=brickwall width=25 height=15>

    All I need to do is connect a recordset from inside a subroutine on a form to a saved query. I can't make it work. I keep getting type mismatches galor.

    I have other questions, but I will post them one at a time.

    Thank you,
    Frank

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: recordsets (2000)

    <<All I need to do is connect a recordset from inside a subroutine on a form to a saved query. I can't make it work. I keep getting type mismatches galor.>>

    What do you exactly mean by this?

    Pat

  3. #3
    New Lounger
    Join Date
    Sep 2002
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: recordsets (2000)

    I am working inside a form called "form_FlyIn" and need to connect a recordset (Dim rstRegis as RecordSet) to a query that I have written and saved on the queries page. If I need to connect to the dataset of another form, it would be something like "Forms!form_Process.recordset", but "Queries!query_FlyInSubRegistrations" doesn't work. Is that clearer?

  4. #4
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: recordsets (2000)

    Hi Frank,

    If you want to reference a query in a recordset, an example follows where "query_FlyInSubRegistrations" is the name of the query :

    Dim dbs as Database, rs as Recordset
    set dbs = CurrentDB
    set rs = dbs.OpenRecordset("query_FlyInSubRegistrations")
    ..etc...

    <<If I need to connect to the dataset of another form, >>
    What exactly do you mean by this? Do you want to reference the controls of another form?

    HTH
    Pat

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

    Re: recordsets (2000)

    You don't connect a DAO recordset to a query, which is what causes some confusion with regard to your question. What you do in DAO (as in Pat's example), is *open* a recordset on that query. If that's what you're trying to do, then Pat has already given you the answer.

    If you're trying to connect the subform to a recordset based on the query, that's another thing entirely. I know it's hard to translate from a familiar environment to an entirely unfamiliar one, so just make your questions as complete as possible. Explain what you want to accomplish, and someone will undoubtedly be able to help you do it.
    Charlotte

  6. #6
    New Lounger
    Join Date
    Sep 2002
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: recordsets (2000)

    It worked! My report now prints out correctly by using the Word Automation articles Bryan Carbonnelle pointed me to and a few tweaks to make it work specifically with my data requirements! Thanks go to Pat for showing me how to tweak it and open recordsets to queries. Thanks to all who helped me in various ways! <img src=/S/clapping.gif border=0 alt=clapping width=19 height=23>

    Charlotte (or any other moderator), is there any way to award "points" on this site for you, Bryan, and Pat for being so helpful? Another programmer's tipsite I visit has such a system. Just curious.

    Frank Luke

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

    Re: recordsets (2000)

    It's a nice idea, but keep in mind that you would have a hard time finding another forum that had the volume of posts in it that we do. The Access board alone has over 30,000 posts, and that's just in the last couple of years. Trying to keep score of points for all the various loungers would add up to a huge undertaking. I'll call the suggestion to the attention of the powers that be, but it isn't likely to happen any time soon.
    Charlotte

Posting Permissions

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