Subject | Re: Inserting Records using IB_Controls: Field x is a Required Field |
---|---|
Author | |
Post date | 2016-04-30T10:47:45Z |
I think I've got to the bottom of this. At least, what I've found seems rational and, as often is the case, so blindingly obvious that I kicked myself for not thinking of this before.
The fields I was having this problem with were always ambiguously-named fields - two or more tables in the SELECT each with the same field name. So I was relying on the tablename prefix to identify which field was which
SELECT stockrecord.stockcode
, supplierstockrecord.stockcode
This seemed to work in the field properties tab, and in the Update SQL tab too, but this is where I wrongly assumed that I could do this for IB_Controls too. It certainly works for the displaying of fields, but not if updating them.
The solution which seems to work (until I prove otherwise) is to alias the non-updateable fields using AS. So if I'm adding records to the supplierstockcode table I would say:-
SELECT stockrecord.stockcode AS srstockcode
, supplierstockrecord.stockcode
Hopefully that's resolved it, but if not I will be back.
The fields I was having this problem with were always ambiguously-named fields - two or more tables in the SELECT each with the same field name. So I was relying on the tablename prefix to identify which field was which
SELECT stockrecord.stockcode
, supplierstockrecord.stockcode
This seemed to work in the field properties tab, and in the Update SQL tab too, but this is where I wrongly assumed that I could do this for IB_Controls too. It certainly works for the displaying of fields, but not if updating them.
The solution which seems to work (until I prove otherwise) is to alias the non-updateable fields using AS. So if I'm adding records to the supplierstockcode table I would say:-
SELECT stockrecord.stockcode AS srstockcode
, supplierstockrecord.stockcode
Hopefully that's resolved it, but if not I will be back.