CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2003
    Location
    Reading
    Posts
    172

    Angry What am i missing?

    I would love to post all my code for someone to take a llok at but I don't own it so I will have to describe it as best I can

    Using Access 2k: I have a main form [frmSwitchboard] with a subform [frmCompanyandProduct] (which, in turn, has a couple of subforms of its own).

    Both forms are bound to the Main Table [tblCompany_Listing] but are not linked to eachother by any form of filter or child/master link. They are working seperatly (I checked this). The recordsets are very simple and are just an 'ORDER BY'ed list of all the companies without any criteria

    In the Subform there is an unbound combobox (this is necessary) which is populated with the names of the companies and their internal IDs.

    There are 22 Companies in the main table at this stage. when the forms are loaded, the frmSwitchboard shows 22 records but the frmCompanyandProducts shows just one! And always the same one! I have checked and checked and there is nothing that I can see to make this one record any different to the others.

    When I open the frmCompanyandProducts form on its own, it shows all 22 records.

    What am I doing wrong??!?!?!?!?!?!11??!??/111!!1//!?!?

    I know that from this description it is VERY hard to make any sort of judgement but if you have come accross this before, PLEASE let me know how you sorted it. It's doing my head right in

  2. #2
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726
    if it were two tables, it could have been a "wrong" join...
    As you said it is only one table, and the underlying query
    is a select * plus a simple order by without any filter,
    it seems really a mistery....
    You sure you do not have code that use combo value to filter
    the records?

    In the Subform there is an unbound combobox (this is necessary)
    which is populated with the names of the companies and their
    internal IDs.
    ...maybe you filtered in an event of combobox, which is triggered
    while you populate it...
    But if combo is populated by recordset (taht is,it is not used to
    filter), it seems as if when you load the form you are around the
    end of record.... you could try a "Recordset.Movefirst"...
    Last edited by Cimperiali; April 22nd, 2004 at 06:38 AM.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  3. #3
    Join Date
    Aug 2003
    Location
    Reading
    Posts
    172
    Thx for the reply

    This is just the thing. I haven't been using filters because ppl need to navigate through the records in a number of different ways. I have been using bookmarks and just moving to the records.

    All three elements (main form, sub form and combo) should be almost completely seperate other than to use bookmarks to navigate around. There are one or two instances where the combo list is changes from rs to value list but this should have no baring on the forms.

    I will see if I can trim it down and post it because it really is a very puzzling problem.

    Let me have a good look at everything again. I must have missed something :/

  4. #4
    Join Date
    Aug 2003
    Location
    Reading
    Posts
    172

    Resolved

    AAARRGGH FOUND THE Fing ERROR

    I am switching between different functions in the application by changing the content of the subform in the switchboard.

    Because the switchboard and frmCompanyandProducts both use the same recordsource, the f@~£$%g thing kept putting in a master/child link while I wasn't looking.

    Oh, how I love the querks of Access VBA

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured