Pop-up form does not reflect ID on Main Form - why??

Andren

Registered User.
Local time
Today, 16:11
Joined
Sep 3, 2002
Messages
55
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
 
Last edited:
Andren said:
Dear all.

If I use code like this:

DoCmd.OpenForm "ClassificationSF", , ,"[Class_ID] = " & Me.Class_ID

in the "On_Click" event in a button on my tabbed page (where "Class_ID" is found in my join-table and also in my query built from the Join-table and Classification-table) I get an error telling me "Missing operator".

I have also tried all sorts of solutions given within this forum with similar results.

/ Anders
 
Last edited:
Andren said:
DoCmd.OpenForm "ClassificationSF", , ,"[Class_ID] = " & Me.Class_ID

in the "On_Click" event in a button on my tabbed page (where "Class_ID" is found in my join-table and also in my query built from the Join-table and Classification-table) I get an error telling me "Missing operator".
/ Anders
When you use an expression of the form Me.something, that "something" needs to be the name of a control on the form running that code. You've mentioned that Class_ID is found in your join-table and in your query, but you didn't say that it was the name of a control on your form. Check that.
 
dcx693 said:
When you use an expression of the form Me.something, that "something" needs to be the name of a control on the form running that code. You've mentioned that Class_ID is found in your join-table and in your query, but you didn't say that it was the name of a control on your form. Check that.


Thanks for answering - I really need any suport now. However

Following your advice I get a Run Time Error (438) saying "Object does not support this property or method".

In my Query I have a criterion in the JoinClass.Class_ID - field saying:
[Forms]![ASID]![Subjects] (where "ASID" is the Main Form and "Subjects" is the Pop-up form.

Inthe Main form (i.e. ASID) I have a bound invisible text box - bound to the "Class_ID"-field in the Query (that is called "Classificatioins").

I also have a button in the main form (ASID) to open the subform called "Subjects". In this button (called "Open1") I put the code in the On_Click Event (together with the standard phrases that Access puts there):

stLinkCriteria = "Class_ID =" & Me!Open1

In the Pop-up Form (in the Before Insert event) i put:

Me.Open1 = Forms!ASID!Class_ID

Still it will not work - giving me run time error 438. What in all the world am I doing wrong ?????

I really appreciate any further comments and thank you for your time.

/Anders
 

Users who are viewing this thread

Back
Top Bottom