Many thanks. Was wondering if you might be able to help with another question.
I have multiple tables as previously mentioned. I want to load data from one table into a QLineEdit on a certain form based on the relationship. At the moment the relationship is created using a ComboBox and the following code:
stockRelationModel = self.stockModel.relationModel(STOCKSUPPLIERID)
self.stockSupplierNameComboxBox.setModel(stockRelationModel)
self.stockSupplierNameComboxBox.setModelColumn(
stockRelationModel.fieldIndex("companyName"))
self.stockMapper.addMapping(self.stockSupplierNameComboxBox, STOCKSUPPLIERID)
stockRelationModel = self.stockModel.relationModel(STOCKSUPPLIERID)
self.stockSupplierNameComboxBox.setModel(stockRelationModel)
self.stockSupplierNameComboxBox.setModelColumn(
stockRelationModel.fieldIndex("companyName"))
self.stockMapper.addMapping(self.stockSupplierNameComboxBox, STOCKSUPPLIERID)
To copy to clipboard, switch view to plain text mode
Do you know how I can load other data from the table based on the STOCKSUPPLIERID variable. The other option would be if I could get it to load a form at the record specified by that ID.
Can anyone give any help.
Bookmarks