Home » Developer & Programmer » Forms » master/detail form
master/detail form [message #79986] Wed, 31 July 2002 04:33 Go to next message
chhan
Messages: 19
Registered: June 2002
Junior Member
Hi All,
i hope someone out there can help me. i am having a problem with my Oracle8i form/subform. The relationship between my form/subform is 1:M. and this is the problem:

when i select a customer, i want my subform to display all the vehicles which belong to that customer. i can do this if i'm using SQL PLUS by typing:

select tblVehicle.VehicleRegestration, tblVehicle.VehicleOwnerID from tblVehicle, VVehicleOwner where tblVehicle.VehicleOwnerID=VVehicleOwner.VehicleOwnerID;

RESULTS:

VEHICLEREG VEHICLEOWNERID
---------- --------------
P23TCS 47
S11ETC 52
S1TON 54
T258CHB 54
T12PET 54
C144TES 47
A155SWE 47

but when i place this code in the form, it doesn't work. the code is placed in 'POST CHANGE' in VehicleOwnerID text box, below is a copy of the code(no error when compile):

begin
select Vehicleid, VehicleRegestration
into :tblVehicle.Vehicleid, :tblVehicle.VehicleRegestration
from tblVehicle
where VehicleOwnerid =:tblVehicle.VehicleOwnerid;
end;

if anyone can help or if they think this is the wrong place to place this message, please let me know.

Many thanks in advance.

Chhan
Re: master/detail form [message #80004 is a reply to message #79986] Thu, 01 August 2002 20:50 Go to previous messageGo to next message
fokker104
Messages: 1
Registered: August 2002
Junior Member
Did you try using the built in master-detail relationship? Add the relationship to the master block, and put your sql statement in the join. Set the appropriate properties in the relationship when you are done. You probably want Deferred-No, and Automatic Query-Yes.
Re: master/detail form [message #80008 is a reply to message #80004] Fri, 02 August 2002 01:51 Go to previous message
chhan
Messages: 19
Registered: June 2002
Junior Member
Hi,

Thanks for answering my query. the relationship between the two tables was already set with the appropriate join, the properties has also been set to Deferred-No, Automatic query-yes. But it still only shows one record in the detail form, when it should show more.

The form show run like this:

User select customer name in the LOV text box. This then populate master form with customer name and ID number. Detail form shows vehicle registration which belongs to that customer.

At the moment, master form populates with correct info. but the detail form does not.

The LOV was created using the LOV Wizard, the returned values populate customerID and name in the master form, and i've written a POST-CHANGE TRIGGER in the customerID text box, which is:

begin
select VehicleOwnerID
into :tblVehicle.VehicleOwnerID
from VVehicleOwner
where VehicleOwnerID=:VVehicleOwner.VehicleOwnerID;
end;

The code is ok because i've tested it in SQL PLUS. but i just can't seem to figure out why the detail form doesn't do what it suppose to?

I hope you can help.

many thanks

chhan
Previous Topic: Re: Developer Form6/Form6i Proble.
Next Topic: Page Up/Page Down
Goto Forum:
  


Current Time: Thu Mar 28 19:14:30 CDT 2024