Re: Fetching records matching condition in a master-detail relation

From: Peter de Wolff <p.c.de.wolff_at_pve.agro.nl>
Date: 1998/04/21
Message-ID: <353CE117.4C820D78_at_pve.agro.nl>#1/1


Maybe you should solve this with a view. Base your master-block on the view and build the view like
select person_id,mydata from mytable where person_id in <other table> where username = USER

Peter

dwarakv_at_hotmail.com wrote:

> Hi,
> I have a form with a master-detail blocks. I have the user logging into
> the application using his/her private code(user_id). When the user performs a
> query on the master block, I would like him/her to see only the people
> associated with him. For e.g., I have users 1, 2. The people associated with
> user 1 are 6, 7, 8. Those associated with 2 are 9, 10, 11. When user 1
> performs a query, he should be able to see only the records corresponding to
> people 6, 7, 8 and he should NOT be able to see anything relating to people
> 9, 10, 11. I do have an LOV which lets user 1 select only from people 6, 7,
> 8. But if the user hits F8, the query shows all the people, namely, 6, 7, 8,
> 9, 10, 11. Is there some way I can do this? I tried assigning to the where
> clause of the master block this condition (master_block.user = user_id, but
> when I try to query, I get error FRM-40505 (unable to perform query)).
>
> I have a second related question. I have different fields in the detail
> block. One of the fields is a status field which tells if the person is in
> the company or not. When doing the query, I don't need the query to show
> people who are no longer in the company. For e.g in the above example itself,
> if person 8 was terminated, when user 1 does a query he should see only
> people 6, 7 and NOT 8.
>
> Thanks
> Dwaraka
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/ Now offering spam-free web-based newsreading
Received on Tue Apr 21 1998 - 00:00:00 CEST

Original text of this message