A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Link subforms to show active record



 
 
Thread Tools Display Modes
  #1  
Old December 22nd, 2004, 11:53 AM
Timboo
external usenet poster
 
Posts: n/a
Default Link subforms to show active record

I have a form with two subforms, when the first subform has a record
highlighted, I would like the other subform to show the details of the active
or highlighted record. In newby speak, is this easily achieved? I have a
verison of the simple database I can email with instructions if this would
clarify what Im trying to do. Thanks Tim

  #2  
Old December 22nd, 2004, 02:28 PM
Ed Warren
external usenet poster
 
Posts: n/a
Default

What you are describing is a set for forms linked

Form A -- Form B (subform) [detail records for A shown in B]
Form A -- Form C (subform) [Detail records for A shown in C]

What you are wanting is

Form A -- Form B (subform of A) -- Form C (subform of B)
Detail records for A shown in B and Detail records for B shown in C.


Ed Warren


"Timboo" wrote in message
...
I have a form with two subforms, when the first subform has a record
highlighted, I would like the other subform to show the details of the
active
or highlighted record. In newby speak, is this easily achieved? I have a
verison of the simple database I can email with instructions if this would
clarify what Im trying to do. Thanks Tim



  #3  
Old December 22nd, 2004, 03:17 PM
Timboo
external usenet poster
 
Posts: n/a
Default

Ed, yes, infact the database is a fault logging system, form A = caller
details, form B = Issues associated with active caller in A, and Form C =
detials of the active issue on form B.

Is this hard to achieve?

Thanks Tim

"Ed Warren" wrote:

What you are describing is a set for forms linked

Form A -- Form B (subform) [detail records for A shown in B]
Form A -- Form C (subform) [Detail records for A shown in C]

What you are wanting is

Form A -- Form B (subform of A) -- Form C (subform of B)
Detail records for A shown in B and Detail records for B shown in C.


Ed Warren


"Timboo" wrote in message
...
I have a form with two subforms, when the first subform has a record
highlighted, I would like the other subform to show the details of the
active
or highlighted record. In newby speak, is this easily achieved? I have a
verison of the simple database I can email with instructions if this would
clarify what Im trying to do. Thanks Tim




  #4  
Old December 22nd, 2004, 03:59 PM
Ed Warren
external usenet poster
 
Posts: n/a
Default

As always there are many way to 'skin this cat'.


1. Build Form B, with Form C as a subform
2. Build Form A, with Form B as a subform.

The 'gottcha' is that Access wants the 'master' form to be in single record
view so form A will be in single record and so will form B. After you
build the forms you can go back and put them back into multiple record views
(at least in Access 98, and 2000).

A better way is to 'syncronize the forms' . I got the following from
Microsoft. In this approach you have several forms open and when you change
the current record in one it automatically filters the records in the
related forms. A little code required, but I like the user interface
better.

open a module add the following function::

Function IsLoaded(ByVal strFormName As String) As Boolean

' Returns True if the specified form is open in Form view or Datasheet view.


Const conObjStateClosed = 0

Const conDesignView = 0


If SysCmd(acSysCmdGetObjectState, acForm, strFormName) conObjStateClosed
Then

If Forms(strFormName).CurrentView conDesignView Then

IsLoaded = True

End If

End If


End Function



add the following code to the oncurrent event of the "master form" (here I
have a 'child form [Client Data] I want to keep in sync with the "master
form" and I want to link using the [CNumber] Field.


Private Sub Form_Current()

stDocName = "CLIENT DATA"


stLinkCriteria = "[CNUMBER]=" & Me![CNUMBER]


If (IsLoaded(stDocName) = True) Then


Forms![CLIENT DATA].FilterOn = True

Forms![CLIENT DATA].Filter = stLinkCriteria

End If

End Sub



Now dress things up by adding a button to open Form B from Form A and then
one to open form C from From B and your good to go.




In Access 2000 + you can use a 'tabbed page' and using events link them the
way you want to.

Hope this helps

Ed Warren.


"Timboo" wrote in message
...
Ed, yes, infact the database is a fault logging system, form A = caller
details, form B = Issues associated with active caller in A, and Form C =
detials of the active issue on form B.

Is this hard to achieve?

Thanks Tim

"Ed Warren" wrote:

What you are describing is a set for forms linked

Form A -- Form B (subform) [detail records for A shown in B]
Form A -- Form C (subform) [Detail records for A shown in C]

What you are wanting is

Form A -- Form B (subform of A) -- Form C (subform of B)
Detail records for A shown in B and Detail records for B shown in C.


Ed Warren


"Timboo" wrote in message
...
I have a form with two subforms, when the first subform has a record
highlighted, I would like the other subform to show the details of the
active
or highlighted record. In newby speak, is this easily achieved? I
have a
verison of the simple database I can email with instructions if this
would
clarify what Im trying to do. Thanks Tim






  #5  
Old December 23rd, 2004, 09:59 AM
Timboo
external usenet poster
 
Posts: n/a
Default

Thank you Ed, will give this a go this afternoon. merry Xmas

"Ed Warren" wrote:

As always there are many way to 'skin this cat'.


1. Build Form B, with Form C as a subform
2. Build Form A, with Form B as a subform.

The 'gottcha' is that Access wants the 'master' form to be in single record
view so form A will be in single record and so will form B. After you
build the forms you can go back and put them back into multiple record views
(at least in Access 98, and 2000).

A better way is to 'syncronize the forms' . I got the following from
Microsoft. In this approach you have several forms open and when you change
the current record in one it automatically filters the records in the
related forms. A little code required, but I like the user interface
better.

open a module add the following function::

Function IsLoaded(ByVal strFormName As String) As Boolean

' Returns True if the specified form is open in Form view or Datasheet view.


Const conObjStateClosed = 0

Const conDesignView = 0


If SysCmd(acSysCmdGetObjectState, acForm, strFormName) conObjStateClosed
Then

If Forms(strFormName).CurrentView conDesignView Then

IsLoaded = True

End If

End If


End Function



add the following code to the oncurrent event of the "master form" (here I
have a 'child form [Client Data] I want to keep in sync with the "master
form" and I want to link using the [CNumber] Field.


Private Sub Form_Current()

stDocName = "CLIENT DATA"


stLinkCriteria = "[CNUMBER]=" & Me![CNUMBER]


If (IsLoaded(stDocName) = True) Then


Forms![CLIENT DATA].FilterOn = True

Forms![CLIENT DATA].Filter = stLinkCriteria

End If

End Sub



Now dress things up by adding a button to open Form B from Form A and then
one to open form C from From B and your good to go.




In Access 2000 + you can use a 'tabbed page' and using events link them the
way you want to.

Hope this helps

Ed Warren.


"Timboo" wrote in message
...
Ed, yes, infact the database is a fault logging system, form A = caller
details, form B = Issues associated with active caller in A, and Form C =
detials of the active issue on form B.

Is this hard to achieve?

Thanks Tim

"Ed Warren" wrote:

What you are describing is a set for forms linked

Form A -- Form B (subform) [detail records for A shown in B]
Form A -- Form C (subform) [Detail records for A shown in C]

What you are wanting is

Form A -- Form B (subform of A) -- Form C (subform of B)
Detail records for A shown in B and Detail records for B shown in C.


Ed Warren


"Timboo" wrote in message
...
I have a form with two subforms, when the first subform has a record
highlighted, I would like the other subform to show the details of the
active
or highlighted record. In newby speak, is this easily achieved? I
have a
verison of the simple database I can email with instructions if this
would
clarify what Im trying to do. Thanks Tim







 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Form drops edited record-inserts new record instead karenk10 General Discussion 0 September 22nd, 2004 10:19 PM
Show last record in subreport based on ID Kurt Setting Up & Running Reports 2 September 13th, 2004 03:57 PM
Link Tables to SQL Server DB - Unique Record Identifier Jason Gyetko General Discussion 4 June 15th, 2004 03:35 PM
Record Locks on Subforms Virgil Layne Using Forms 1 June 2nd, 2004 03:13 PM
Form Doesn't Go To New Record Steve New Users 15 May 16th, 2004 04:33 PM


All times are GMT +1. The time now is 03:07 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.