Dear all.
I'm stuck again - despite all help that I got.
To review:
Now I have five tables in a many-to-many fashion:
Writers: (Names etc)
Titles: (Titles etc)
Classification: Classifications (yes/no-fields)
Main: (various information )
Join: (writersID,TitlesID,ClassID,MainID)
I have queries (for example a query build from Join and Classification
only showing info about whether a paper or book is about certain subjects.
I call it "Subjects" query.
I have a main form called "ASID" (Addiction Severity Index Database, that is).
In this form I have a Tabbed Control with many tabs on that works OK.
I also have one text-box bound to the Class_ID field in the "Subject" Query
Then I have a Tab called "Classification" In this I have buttons to bring several pop-up forms up.
In these pop-up forms I have an ID-field to be sure that I put in info related to the same reccord as I have in the main form.
Now - in the Query I have tried different criteria solutions after reading many posts here. For example:
[Forms]![ASID]![SubjectsSF] (pointing to the subform “SubjectsSF”)
Or
[Forms]![ASID]![Class_ID] (poiting to the textbox "Class_ID", bound to ID-field in query “Subjects”).
Neither works.
In the button on the tabbed control I have code on the "Click Event" like:
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "SubjectsSF" ’(Name of subform)
stLinkCriteria = "Class_ID =" & Me!Class_ID
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_OpenSubjects_Click:
Exit Sub
And in the Before Insert event of the Subform I also put some code as adviced (Me.Class_ID = Forms!ASID!Class_ID)
But I can't make the ID-field on the subform to reflect the same ID-number as I have on the main form or in the navigation-bar.
So once again - I would be so grateful for any concrete help on this subject.
Where to put what and why.
/ Anders
I'm stuck again - despite all help that I got.
To review:
Now I have five tables in a many-to-many fashion:
Writers: (Names etc)
Titles: (Titles etc)
Classification: Classifications (yes/no-fields)
Main: (various information )
Join: (writersID,TitlesID,ClassID,MainID)
I have queries (for example a query build from Join and Classification
only showing info about whether a paper or book is about certain subjects.
I call it "Subjects" query.
I have a main form called "ASID" (Addiction Severity Index Database, that is).
In this form I have a Tabbed Control with many tabs on that works OK.
I also have one text-box bound to the Class_ID field in the "Subject" Query
Then I have a Tab called "Classification" In this I have buttons to bring several pop-up forms up.
In these pop-up forms I have an ID-field to be sure that I put in info related to the same reccord as I have in the main form.
Now - in the Query I have tried different criteria solutions after reading many posts here. For example:
[Forms]![ASID]![SubjectsSF] (pointing to the subform “SubjectsSF”)
Or
[Forms]![ASID]![Class_ID] (poiting to the textbox "Class_ID", bound to ID-field in query “Subjects”).
Neither works.
In the button on the tabbed control I have code on the "Click Event" like:
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "SubjectsSF" ’(Name of subform)
stLinkCriteria = "Class_ID =" & Me!Class_ID
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_OpenSubjects_Click:
Exit Sub
And in the Before Insert event of the Subform I also put some code as adviced (Me.Class_ID = Forms!ASID!Class_ID)
But I can't make the ID-field on the subform to reflect the same ID-number as I have on the main form or in the navigation-bar.
So once again - I would be so grateful for any concrete help on this subject.
Where to put what and why.
/ Anders
Last edited: