Unanswered: Compile error - method or data not found
I have a "Registrants" table which includes a field titled "Registrant Master No". This field is a concatenation of first initial, last name and last four digits of phone number. Also on this form is a DOB field and after update, another field is populated to report their age as of September 1 of the current year. My goal is to have a child register for a sporting event, and based on their age (as of 01 Sep) determine if they should participate in the under 12 soccer, under 10 soccer and so on.
I have an events table where all the summer events are entered. Dance, music, soccer etc. If soccer is chosen, then certain check boxes are enabled to determine what age group this event should be. If it is under 12 for instance - than all the other checkboxes are disabled.
My problem arises when I want to enter the names for participants in the events. I have a junction table titled participants which has the primary key references to events and participants and I have made an entry form with events and participants as a subform. On the registrants subform, when I wish to select a person for one of my events, a combo box of all the Registrant Master No's appear and I can choose one.
My goal as I mentioned was to determine if that particular registrant was too old for the event (i.e. his age was 13 - so he can not play under 12 soccer) and I have entered this code so far
Private Sub Registrant_AfterUpdate()
If [event_type.id] = 1 And Registrant.Program_Age > 12 And (soccer.Under_12 = -1 Or soccer.Under_10 = -1 Or soccer.Under_8 = -1 Or soccer.Soccer_Skills = -1) Then
MsgBox "too old for event"
I would also like it to rollback and not allow the registrant to be selected - but I am not there yet.
The compile error highlights the Program_Age field - and if I put square brackets around it or square brackets around Program.Age and drop the Registrant - another error - runtime 2465- can not find '|' referred to in your expression. Any suggestions?
Yes, event_type is a table and event_type.id is the primary key. In an attempt to normalize the database, all of the "event types" of this recreational database are on this table. In this way, future recreational events, (i.e. music class, dance, baseball etc)can be added by a clerk. In this example, event_type.id =1 referees to soccer events in the community
Compile error - now "Runtime error 424" Object required
I seem to be making matters worse. With the removal of the brackets - a new error "Runtime error 424" - object required now appears. It does not look like that it knows what it wants to be searching for.