Scenario:
I have inherited a table with two fields, one decimal, one string. These together represent the primary key. I need both fields on a maintenance form, bound to textboxes.
Display/Edit/Save is working. I cannot get a new record to add.
I get 'Conversion from type 'DBNull' to type 'String' is not valid.' on the line:
Return CType(Me.CurrentRow.Item("ITREPORT"), System.String) in the field properties. I tried to set the defaultValues and the first one sets fine, the second always gives the above error, regardless of the order set. I have PrimaryKeyIsAutoIncremented = False, PrimaryKeyIsUpdateable = True, and even tried out AllowNullsOnNewRow = True. The database fields (DB2) are set to not allow nulls, and have default values set.
I know this could be fixed easily by adding a proper autoincrement key column but I cant, the table is part of a legacy system and the customer is insistant it work as described above, frankly I'm not sure why it isnt. It works fine if the fields are unbound from the textboxes.
I must be missing somethign simple. Which is likely since I havent been coding much lately.
Keith Chisarik