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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DBGrid binding to a database

Status
Not open for further replies.

mark06

Programmer
Apr 26, 1999
21
0
0
GB
My select statement to generate the DBGrid in VB6 contains a join from the data table to the reference table so descriptive text is displayed instead of a code number. When I change the text entry (via a dropdown from the appropriate column - button property set to true) the reference table is updated as well as the data table. Does anyone know how I can stop updates to the reference table?
 
Use the allowupdate property to false<br>

 
I need to clarify with an example ...<br>
Reference table structure is (RefID int,RefDS varchar(50)), Data table structure is (DocID int,RefID int,DocDS varchar(50)). Reference table contains :<br>
RefID RefDS<br>
1 Fruit<br>
2 Vegetable<br>
3 Animal<br>
Data table contains :<br>
DocID RefID DocDS<br>
1 1 The life and times of a tomato<br>
2 1 The grapes of wrath<br>
3 3 A man called horse<br>
Datagrid select statement :<br>
select d.docid,d.refid,r.refds,d.docds from data d,reference r where d.refid=r.refid<br>
Datagrid properties :<br>
columns 0 and 1 are not visible<br>
column 2 has button property set to true<br>
What happens :<br>
For DocID=1, I click on the refds button to get a drop down of valid RefDS values. I select Vegetable. Reference is updated correctly, changing RefID from 1 to 2 for DocID 1. However RefDS in the Reference table for RefID 1 is updated to Vegetable!<br>
I can't use allowupdate=false because this is a grid-wide setting which I don't want. I'd also like to avoid using multiple grids if possible.<br>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top