Solved Referencing a combobox in 2nd Subform, Vba Runtime error 2455 Invalid reference to the propery form / report (1 Viewer)

Manos39

Registered User.
Local time
Today, 11:02
Joined
Feb 14, 2011
Messages
248
Here is what I have. It is much simplified and works. All subforms are continuous.
Just tested it. It does not TRY your self. See having selected a race in 1st subform which is for women, choce i have when i need to record womens times only in my related sub form, is for BOTH men and WOMEN
 

Attachments

  • Larry 2022-06-30 231112.jpg
    Larry 2022-06-30 231112.jpg
    85.9 KB · Views: 84

Manos39

Registered User.
Local time
Today, 11:02
Joined
Feb 14, 2011
Messages
248
Larry i need you to understand me this is what i need but in continues mode subforms
 

Attachments

  • MEN only 2022-06-30 231417.jpg
    MEN only 2022-06-30 231417.jpg
    87.5 KB · Views: 81
  • Women only 2022-06-30 231452.jpg
    Women only 2022-06-30 231452.jpg
    80.9 KB · Views: 84

LarryE

Active member
Local time
Today, 11:02
Joined
Aug 18, 2021
Messages
581
Then open the subforms in design mode and change the Default View to Continuous from Data Sheet. I am so sorry I could not help you. Maybe some else can help you further. Since I cannot read your language, I could not tell from the data which is Men and which is Women. I have done all I can.

In this final file, I did include a GenderID filter in the Ahtletes / Times form, so it should filter based on gender record selected in the Races form. It's the best I could do.
 

Attachments

  • SwimmerDatabase.accdb
    2.3 MB · Views: 98
Last edited:

Manos39

Registered User.
Local time
Today, 11:02
Joined
Feb 14, 2011
Messages
248
These are the true conditions for selecting either male or female athlete swimmers when referring from Tbl_Times (athleteID)
to Tbl_Races (depending on Gender) between record sets

Code:
 DLookUp("agenderID";"Tbl_Athletes";"athleteID=" & Nz(DLookUp("genderID";"Tbl_Races";"raceID=" & Nz(([Forms]![Fr_Gala]![Frmsub_Race].[Form]![raceID]);0));0))
.. but no idea comes on how put it in the rowsource of athleteID in Frsub_Time..

new try picture is indicating in 1st sub a stroke of men's 100m and in 2nd sub one could choose men AND women athletes
 

Attachments

  • SwimmerDatabase.accdb
    2 MB · Views: 92
  • 2022-07-01 021125.jpg
    2022-07-01 021125.jpg
    93.9 KB · Views: 85
Last edited:

LarryE

Active member
Local time
Today, 11:02
Joined
Aug 18, 2021
Messages
581
  1. Open the athleteID Row Source on the form
  2. Add the agenderID field from the tbl_Athletes table
  3. Put [Forms]![Fr_Gala]![Frmsub_Race]![genderID] in the Criteria box in the agenderID field
 

Attachments

  • SwimmerDatabase1.accdb
    928 KB · Views: 99

Manos39

Registered User.
Local time
Today, 11:02
Joined
Feb 14, 2011
Messages
248
  1. Open the athleteID Row Source on the form
  2. Add the agenderID field from the tbl_Athletes table
  3. Put [Forms]![Fr_Gala]![Frmsub_Race]![genderID] in the Criteria box in the agenderID field
I have tried that Larry, test it does not work.. wait if in 1st sub and in the after update event of genderID is put to requery athletesID in second sub form, with Me.Parent.Frmsub_Time.Form.athleteID.Requery , then it works... but i t has some issues though.. If athletes and times are typed athletes are getting lost when close and reopen main form
 

Attachments

  • SwimmerDatabase 2.accdb
    1.3 MB · Views: 98
Last edited:

Users who are viewing this thread

Top Bottom