Results 1 to 10 of 10
  1. #1
    floresaj is offline Novice
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    8

    "Object or class does not support the set of events"

    This is probably a very basic question:



    I have two tables: a master table and a linked table that contains multiple entries for each unique ID in the master table. Both tables are also linked by a query that pulls from both.

    I've created a subform that displays the multiple entries from the linked table for each unique ID: IE the sub table shows all the referrals and the data for each of those referrals for the specific ID in the master form/table (I hope that makes sense).

    I need to be able to add new referral information (new records?) to the referral table using the subform, and to have the new data appear on the linked table under the appropiate unique ID (so it the subform needs to automatically generate a new record using the existing ID).

    I've tried so many different things (and broken the database on a few of those attempts) and I'm just not making headway. I don't really know VBA or SQL language so I need some real help.

    Thank you so very much.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Each table should have its own PrimaryKey (PK - hopefully an AutoNumber). Your Referral table should have an additional LongInteger field as a ForeignKey (FK) field where the appropriate MasterTable PK goes. When you use a Form/SubForm arrangement in Access the SubFormControl (the control on the MainForm that displays the SubForm) has two important properties: MasterFields and ChildFields. If you point the MasterFields property to the PK on the MasterForm table/query and the ChildFields property to the FK field of the SubForm then Access will automatically complete the FK field whenever you add a new record to the SubForm.

  3. #3
    floresaj is offline Novice
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    8
    Thanks for your response:
    Let me be sure I understand the correct next steps before I ruin my database for all users.
    Currently my PK on the main database is the customer number (which contains letters and is saved as a text field). I need to add an auto number field, and make that the PK (formatted as a long integer). This will not affect how the rest of the queries and forms work? Will I need to rebuild anything? All the forms and queries are currently taged to the memberID.
    I’ll need to link the referral table to the master table using *this* PK (as a long integer)
    The rest of the material seems to be the same as what I’m doing now. I’m assuming the relationship between the master table (Table1) and the linked table (tbl_rc) needs to be a one to many relationship?
    It seems as if the only difference between what you are proposing as what I have now is the nature and designation of the PK field. Is there something else I should be looking at?
    Thank you very much.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Then just hold the phone a bit. Do you currently have the PK (Text) field of Table1 stores in a FK field in the tbl_rc table and do you have the Master/ChildFields properties pointing to these fields in your Form/SubForm arrangement?

  5. #5
    floresaj is offline Novice
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    8
    yes, that is correct, if I read the database correctly. The subform will show existing records in the tbl_rc table and I can usually edit that information.

    Two bits of information may help. I'm not able to get the tbl_rc table to update or include all the table1 records than do not have specific referral data, and when "Add New" is available (which it isn't always) it will not add a new record for the tbl_rc table using the current uniqueID. Oh because there are multiple entries in tbl_rc for each table1 UniqueID the PK on the tbl_rc is an auto number field.

    Does any of this help?

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Normally you would *not* include the tbl_rc table in the RecordSource of the MainForm. Have you done this?

  7. #7
    floresaj is offline Novice
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    8
    I don't believe so, the tbl_rc table is only referred to in the subform data, as far as I can tell.

    I may need to rebuild that section of the database, but thats not helped much in the past.

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    What is the query you mentioned in the first post? Is it in use with this form?

  9. #9
    floresaj is offline Novice
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    8
    MAYBE.....

    Okay I seem to have maybe fixed it. When I created the subform, Access automatically created a new subform-object and linked my embedded subform to that object and not to the original table. The settings on that subform-object were set to "Allow Edits: No" I changed that and the subform now seems to do what I want.

    I'm still holding my breath and testing the living heck out of this to elliminate anhy paranoia, but this *seems* to have made a difference.

  10. #10
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    It now sounds like it is set up as I would expect. The MainForm RecordSource set to the MainTable and the SubForm RecordSource set to the SubTable.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 04-14-2011, 03:46 PM
  2. "Group By" causes "ODBC--Call Failed" error
    By kaledev in forum Queries
    Replies: 1
    Last Post: 03-09-2011, 02:43 PM
  3. runtime error "Object Not Set"
    By specauto in forum Access
    Replies: 1
    Last Post: 08-22-2010, 12:12 PM
  4. object or class does not support the set of events
    By couch potato in forum Programming
    Replies: 2
    Last Post: 03-20-2010, 08:55 AM
  5. "doCmd - can't find object"
    By drmcfall in forum Access
    Replies: 1
    Last Post: 08-18-2009, 09:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums