Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Add Code to Valid Event
Message
From
07/03/1999 22:27:30
 
 
To
07/03/1999 21:58:38
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00194923
Message ID:
00195076
Views:
16
>>I have a child-parent relationship on one field. WHen displaying the child table in a grid I wanted to have a combo box to allow the user to only select from the values that are available in the parent table...
>>
>
>I don't understand. A combobox in the grid? Is it bound to the foreign key? Can you explain a little more about what you are trying to do?

Thanks for the reply Eric

I have a grid with several fields in it to edit the table. One field is based on another table ie. the value in that field must be from a list of values from the related table. What I wish to do is to display the value from the table I am editing and if I select the column where the data is bound to another table then the list of values from the second table pops up. When a selection is made the data is copied to the current record of the child table. I can get everything to work except copying the data from the parent table to the child table. The code I have so far is:
*Init for the grid
LOCAL lnColCnt, lnCnt
lnColCnt = This.ColumnCount
lnCnt = 1
FOR lnCnt = 1 to lnColCnt
	* Find the column for the RodId
	IF UPPER(This.Columns(lnCnt).ControlSource) = "RODID"
		This.Columns(lnCnt).Bound = .F.
		This.Columns(lnCnt).AddObject("cboRodId", "COMBOBOX")
		This.Columns(lnCnt).CurrentControl = "cboRodId"
		This.Columns(lnCnt).cboRodId.Visible = .T.
		This.Columns(lnCnt).Sparse = .T.
		This.Columns(lnCnt).cboRodId.RowSourceType = 6
		This.Columns(lnCnt).cboRodId.RowSource = "Rod.RodId"
		This.Columns(lnCnt).cboRodId.FontSize = 8
	ENDIF
ENDFOR
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform