Filtering records

Hell All,

My database has 3 tables Client, Devices and Job

Client and Device has One-to-Many Relationship
Client and Job has One-to-Many Relationship
Device and Job has One-to-Many Relationship

I have created a form which allows me to search a particular Client so
that its subform displays Devices for that client.

I want to create a form which allows me to view Jobs related to a
Client and its respective Device.

Hope I make some sense.

matuag
Matuag [ Di, 25 Dezember 2007 10:16 ] [ ID #1893584 ]

Re: Filtering records

Matuag wrote:
> Hell All,
>
> My database has 3 tables Client, Devices and Job
>
> Client and Device has One-to-Many Relationship
> Client and Job has One-to-Many Relationship
> Device and Job has One-to-Many Relationship
>
> I have created a form which allows me to search a particular Client so
> that its subform displays Devices for that client.
>
> I want to create a form which allows me to view Jobs related to a
> Client and its respective Device.
>
> Hope I make some sense.
>
> matuag

I take you have a form with 2 subforms; MainForm, JobForm, DeviceForm.
Open up the property sheet and click on the subform for Job. Set the
master/child link to the ClientID

In the OnCurrent event of the Job subform enter something like
Me!MainForm!DeviceForm.Form.Filter = "JobID = " & Me.JobID
Me!MainForm!DeviceForm.Form.FilterOn = True
since this is a continuous/datasheet form.

When you add a new client you will have to refresh the device form if
the JobForm's OnCurrent event doesn't fire . Maybe something like
Me!DeviceForm.Form.Filter = "JobID = 0"
Me!DeviceForm.Form.FilterOn = True

Wild
http://www.youtube.com/watch?v=tMjM7292eHk
Salad [ Di, 25 Dezember 2007 14:48 ] [ ID #1893586 ]

Re: Filtering records

Thanks I will try this.

On Dec 25, 6:48 pm, Salad <o... [at] vinegar.com> wrote:
> Matuag wrote:
> > Hell All,
>
> > My database has 3 tables Client, Devices and Job
>
> > Client and Device has One-to-Many Relationship
> > Client and Job has One-to-Many Relationship
> > Device and Job has One-to-Many Relationship
>
> > I have created a form which allows me to search a particular Client so
> > that its subform displays Devices for that client.
>
> > I want to create a form which allows me to view Jobs related to a
> > Client and its respective Device.
>
> > Hope I make some sense.
>
> > matuag
>
> I take you have a form with 2 subforms; MainForm, JobForm, DeviceForm.
> Open up the property sheet and click on the subform for Job. Set the
> master/child link to the ClientID
>
> In the OnCurrent event of the Job subform enter something like
> Me!MainForm!DeviceForm.Form.Filter = "JobID = " & Me.JobID
> Me!MainForm!DeviceForm.Form.FilterOn = True
> since this is a continuous/datasheet form.
>
> When you add a new client you will have to refresh the device form if
> the JobForm's OnCurrent event doesn't fire . Maybe something like
> Me!DeviceForm.Form.Filter = "JobID = 0"
> Me!DeviceForm.Form.FilterOn = True
>
> Wildhttp://www.youtube.com/watch?v=tMjM7292eHk
Matuag [ Mi, 26 Dezember 2007 19:46 ] [ ID #1893855 ]
Datenbanken » comp.databases.ms-access » Filtering records

Vorheriges Thema: Mail Merge to Access 2003
Nächstes Thema: Scan with Object or DAO.Recordset