Split subform over two tabs

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have too many field on a subform, so that the user would have to scroll on
the screen to view them all, not a good thing. Therefore I would like to
split the number of fields on a subfom accross two tabs. Any suggestions to
split so that the subfom recordset on both tabs are "in sync" when you
navigate through the recordset.

Further Explanation

If we use the example of "Customer" and "Customer Representative" as the
Main and subforms respectively, if I create two subforms with some "customer
representative" data on one subform and some more "customer representative"
data on another subform on a another tab, they are not 'linked" to each
other.

Such that when I navigate through the records on the first subfom from say
Joe to Mary to Paul (customer reps), it does not change the detail on the
second subform. That is, on the second tab, I would still be looking at Joe's
details, not Pauls as I reuqire.

Any suggestions to solve? Thanks
 
Good evening

It sounds as if you forgot to link the tables. Look at your LinkMasterField,
LinkChildField properties.

Best Regards

Maurice St-Cyr
Micro Systems Consultants, Inc.
 
Griffo,

I had a similar problem with a subform and I will tell you how I handled it
even though
it won't entirely answer your question. In my case, my subform was already
one of several
tabs on a form and I did not want to put tabs on tabs on tabs if you know
what I mean.
So, the first subform displays in datasheet view on a tab and the additional
records that didn't
fit without scrolling I put on a form that displays in form view when I hit
a command button on the
first form. In the underlying query of the second form, I have as criteria
for the Record Id field set to
the record id of the first form, in my case that is
Forms!Customers!StringingRecordsSubform!Record#.
In the Current event of the first form I have the following code to ensure
that navigation through the first
is in synch with the second.

Private Sub Form_Current()
Dim strCond2 As String
strCond2 = "[Record#] =
Forms!Customers!StringingRecordsSubform![Record#]"

If IsLoaded("frmAdditionalRecords") Then
Forms![frmAdditionalRecords].FilterOn = True
Forms![frmAdditionalRecords].Filter = strCond2
End If

End Sub

Hope that helps.

Edward G the unholy- user of Lookup fields, Send Keys and Unsplit databases
 
Griffo,
I realized after posting this that perhaps you have not already added the
IsLoaded function to your database. Without it the code I
offered you will not work. It is a pretty useful item so if you aren't
already using it you might want to add it to the Modules portion of your
database. Here's the code for the IsLoaded 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

Edward G the unholy

Edward G said:
Griffo,

I had a similar problem with a subform and I will tell you how I handled it
even though
it won't entirely answer your question. In my case, my subform was already
one of several
tabs on a form and I did not want to put tabs on tabs on tabs if you know
what I mean.
So, the first subform displays in datasheet view on a tab and the additional
records that didn't
fit without scrolling I put on a form that displays in form view when I hit
a command button on the
first form. In the underlying query of the second form, I have as criteria
for the Record Id field set to
the record id of the first form, in my case that is
Forms!Customers!StringingRecordsSubform!Record#.
In the Current event of the first form I have the following code to ensure
that navigation through the first
is in synch with the second.

Private Sub Form_Current()
Dim strCond2 As String
strCond2 = "[Record#] =
Forms!Customers!StringingRecordsSubform![Record#]"

If IsLoaded("frmAdditionalRecords") Then
Forms![frmAdditionalRecords].FilterOn = True
Forms![frmAdditionalRecords].Filter = strCond2
End If

End Sub

Hope that helps.

Edward G the unholy- user of Lookup fields, Send Keys and Unsplit databases














GRIFFO said:
I have too many field on a subform, so that the user would have to
scroll
on
the screen to view them all, not a good thing. Therefore I would like to
split the number of fields on a subfom accross two tabs. Any suggestions to
split so that the subfom recordset on both tabs are "in sync" when you
navigate through the recordset.

Further Explanation

If we use the example of "Customer" and "Customer Representative" as the
Main and subforms respectively, if I create two subforms with some "customer
representative" data on one subform and some more "customer representative"
data on another subform on a another tab, they are not 'linked" to each
other.

Such that when I navigate through the records on the first subfom from say
Joe to Mary to Paul (customer reps), it does not change the detail on the
second subform. That is, on the second tab, I would still be looking at Joe's
details, not Pauls as I reuqire.

Any suggestions to solve? Thanks
 
Your problem is simple enough. Your entire record to displayed in sub forms
must be related to the main record via some relational identifier. That
identifier should be represented in each subform's [Link Child Fields]
property. Then the related identifier from the main record should be
represented in the [Link Master Fields] property.

Hope this helps. Best of luck!
 
Back
Top