Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

One-to-many relationship is broken

Status
Not open for further replies.

augustin

Programmer
Jun 18, 2003
26
RO
I've got a form with two grids. In the first grid I have the data of a table ( 'Schedule' - child ) that is in relation with table 'Doctors' ( master ).
In the second grid I have values of a field from table 'Reserv' which are obtained from a cursor:

This.RecordSource = ''
Select ora_prg from reserv ;
Where ( m_id = doctors.m_id ) AND ( data_prg = lddata ) Into Cursor prgzi
This.RecordSource = 'prgzi'

The above code is placed in Thisform.grid2.Refresh and this method is called in ThisForm.OleData.Change and
ThisForm.cboDoctor.InteractiveChange.

The problem is, that in the first grid data is diplayed incorrectly.

 
I'm not sure this will work, just try it


cAlias = alias()
nRec = recno()

This.RecordSource = ''
Select ora_prg from reserv ;
Where ( m_id = doctors.m_id ) AND ( data_prg = lddata ) Into Cursor prgzi
This.RecordSource = 'prgzi'

Select (cAlias)
Go nRec


Hope it works
Regards


-- AirCon --
 
Yes, it works, but only when I run application from VisualFox (6.0). If I start application from Windows (XP) the grid2 shows nothing.
Also, in the form I've got lblReservation which shows the day of week ( word ) and is changed in Thisform.grid2.Refresh. The same symptom as the grid2.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top