Form with 2 views of same table

  • Thread starter Thread starter Graham Johnson
  • Start date Start date
G

Graham Johnson

I am trying to create a form with 2 linked views of the
one table. View 1 is a datasheet & view 2 is a single form
that I wish to use to display all fields in the table, as
well as for update/add new records.

Is this possible? If so, any guidance will be
appreciated.
 
If you are using Access 2000 or higher then the following method works well:

- Create the datasheet and detail forms as two separate forms.
- Create a thirid, unbound, form and add the first two as subforms. Call the
subform controls subDatasheet and subDetail (or some other meaningful name).
- Put the following code in the open event of the unbound form:

Set Me.subDetail.Form.Recordset = Me.subDatasheet.Form.Recordset

In Access 97 you can't assign recordsets to forms so you would need more
complex code.
 
This is a very simple way to solve your problem. This should work with
access 2000 and xp:
Create two subForms (frmSubColumnar and frmSubTabular) based on the same
data. Than embed both as subForm on a main form. Put the following code to
the main form.
Load event procedure.
Private Sub Form_Load()
'Let both form share the same recordset
Set subColumnar.Form.Recordset = _ subTabular.Form.Recordset
End Sub
note the different name for the recordset referring to the subform controls.
This code can be found in Access 2000 developer handbook volume 1 desktop
edition.
from Sybex a book which i recommend
yours
harry
yours
Harald
 
Back
Top