Relationship Problem? Maybe?

  • Thread starter Thread starter Oli
  • Start date Start date
O

Oli

Hi (no, this is not a marital problem!)

OK, I have a database, and a certain section of it is suppose to log calls
to and from any given client.

I successfully have my main form showing all the calls in the database as a
subform in Continuous Forms mode. However, I only want the subform to show
the calls from the current client record. I am really stuck on this one. I
have both the ClientID and the NoteID (PK) being saved to the CALLS table
but my form won't show just the records relating to the current ClientID.

If anyone could have a look, I would be very grateful.
I have uploaded the database, www.keybm.com/mdb/KeyBM.zip and the main form
is frm_Contacts and then tab "Call Logs".

Many many TIA
Oli
 
Oli:

Open the main 'Clients' form in design view and select the 'Calls' subform
control. In its properties sheet enter ClientID as both the LinkMasterFields
and LinkChildFields properties. If you still have problems post back and
I'll have a look at your file.
 
Ken Sheridan said:
Oli:

Open the main 'Clients' form in design view and select the 'Calls' subform
control. In its properties sheet enter ClientID as both the
LinkMasterFields
and LinkChildFields properties. If you still have problems post back and
I'll have a look at your file.
Hi Ken

I do not see the properties to which you refer within the properties
dialogue box?

TIA
Oli
 
Oli:

Sounds like you might not be selecting the right control. What you want is
the one on the main clients form which 'contains' the subform. The name
given to this will depend on just how you added the subform to the main form,
but by default Access prefixes the control name for this type of control with
'Child' and the title bar of the properties sheet for this type of control
reads 'Subform/Subreport'. The LinkMasterFields and LinkChildFields
properties are on the Data tab of the properties sheet.

What these properties do is act in the same way as the JOIN clause in a
query, so the data in the subform is restricted to those rows where the
LinkChildFields field's value matches that of the LinkMasterFields value for
the current record in the main form. The LinkMasterFields property is thus
usually the name of the primary key of the main form's underlying recordset
and the LinkChildFields property the name of the corresponding foreign key
column in the subform's underlying recordset.
 
Ken,

Done it! Spot on thanks!

Ol

Ken Sheridan said:
Oli:

Sounds like you might not be selecting the right control. What you want
is
the one on the main clients form which 'contains' the subform. The name
given to this will depend on just how you added the subform to the main
form,
but by default Access prefixes the control name for this type of control
with
'Child' and the title bar of the properties sheet for this type of control
reads 'Subform/Subreport'. The LinkMasterFields and LinkChildFields
properties are on the Data tab of the properties sheet.

What these properties do is act in the same way as the JOIN clause in a
query, so the data in the subform is restricted to those rows where the
LinkChildFields field's value matches that of the LinkMasterFields value
for
the current record in the main form. The LinkMasterFields property is
thus
usually the name of the primary key of the main form's underlying
recordset
and the LinkChildFields property the name of the corresponding foreign key
column in the subform's underlying recordset.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top