Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2006
    Posts
    157

    Unanswered: establish another connection to database? (was "Small Problem")

    hi, minor question, really

    i have a BOM type relationship in my database
    containing master and subordinates

    i have a form displaying a single master record
    but on a command button i need to go through the subordinates...

    what i'm doing now is open a hidden form, filtered by master so i'm able to go through subordinates

    question: would it be better if i established another connection to database to cycle through the records... or am I missing a very plain solution here

    thanks to those who can devote sometime to give some meaningful input here...
    Only quitters quit!

  2. #2
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941
    If you are "cycling through the records", you probably are better off
    using a recordset instead of a form.
    Inspiration Through Fermentation

  3. #3
    Join Date
    Apr 2006
    Posts
    157
    but curiously, what should i use to get the recordset...
    DAO? ADO? or is there a way that i wont have to add another reference library?
    Only quitters quit!

  4. #4
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941
    What is it you're doing when going through the subordinate records?
    Getting a total?
    Updating information?
    ...
    Inspiration Through Fermentation

  5. #5
    Join Date
    Apr 2006
    Posts
    157
    extracting information
    then making some operations with them

    i really have no other choice but to scan each subordinate record
    Only quitters quit!

  6. #6
    Join Date
    Nov 2003
    Location
    Sussex, England
    Posts
    404
    I'm not sure that I fully understand the problem so this might be way off the mark.

    I'd suggest identifying the criteria needed to filter the set of records you need to cycle through. Write a query with one field asking for the criteria,

    e.g. fk_ID=get_ID()

    Base a form on the query.

    On your main form put a line in the button something like:

    set_ID me.ID

    In a module one function

    public function get_ID()
    get_ID = ID
    end function

    public sub set_ID(Id_IN)
    ID=Id_IN
    end sub

    and a private variable

    Private ID as long

    (The button then sets the value - the query can pick this up. The next command under the button should open the relevant form which will be based on a valid query and you should be able to cycle through all the records.)

    Just a suggestion.

Posting Permissions

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