View Single Post
  #4  
Old April 26th, 2010, 03:45 PM posted to microsoft.public.access.forms
BruceM via AccessMonster.com
external usenet poster
 
Posts: 448
Default Two subforms, one based on selection in the other

Type and Document are also reserved words. For more information, and a
utility to find such problems:
http://www.allenbrowne.com/Ap****ueBadWord.html

If you cannot change the names you need to be sure they are always in square
brackets.

I still do not understand the table structure. However, I doubt you can
display the information in the desired format on a form based on a single
query. Subforms would work better for displaying related information. If a
tag record may have many related records, use a form based on the Tag table,
and a subform based on the Document table. If a user may have many related
Tag records, the User table is the source for the main form, with a subform
based on the Tag table, which in turn has its own subform based on the
Document table.


atledreier wrote:
The ownership to tags is based on [area]. I have a table

TBL_Users_Area:
User
Area

A query returning the Documents and relevant tags:
(Some fields are named different from the earlier post, I translated
the field names for it to make sense to non-norwegian people :-) )

SELECT Doc_ref.Docid, Doc_ref.Genid_1, Doc_ref.Type
FROM (TBL_Bruker_Modul INNER JOIN Document ON TBL_Bruker_Modul.Modul =
Document.Area) INNER JOIN Doc_ref ON Document.Docid = Doc_ref.Docid
WHERE (((TBL_Bruker_Modul.Login)=getlogin()))
ORDER BY Doc_ref.Docid;

Another query returning documents and their descriptions only.

SELECT Document.Docid, Document.Description
FROM TBL_Bruker_Modul INNER JOIN Document ON TBL_Bruker_Modul.Modul =
Document.Area
GROUP BY Document.Docid, Document.Description, TBL_Bruker_Modul.Login
HAVING (((TBL_Bruker_Modul.Login)=Getlogin()));

The Getlogin function:

Public Function getlogin()
getlogin = Login
End Function

'Login' is a public variable set when the user start the application.

The 'Tag' field is set in stone, sadly. The data structure is set by
my client, since the underlying database is imported to a 3rd party
system on their end.

First, don't use the word Tag as a field or control name. Â*It is a reserved
word (it is a property of controls and forms), so using it as a field name

[quoted text clipped - 28 lines]
--
Message posted via AccessMonster.comhttp://www.accessmonster.com/Uwe/Forums.aspx/access-forms/201004/1


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201004/1