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!

Required value message on datawindow

Status
Not open for further replies.

061178

Programmer
Jul 7, 2005
41
GB
I have a datawindow and when I try to save I get the message 'Required value missing for [field name] on row 1. Please enter a value'. This is usualy a message that appears when there is no default value set for a field on the dw. The field in question is a checkbox and the default value is 'N' (as other checkboxes on the window). I added this checkbox and set the default yet this message still appears. Any ideas anyone? If there is a way of setting this default value in code what should I search for to see if this is occurring? Thanks muchly.
 
BTW: the field in the database table allow NULLS.
 
This may sound like an obvious question, but have you specified "Y" and "N" for the "Data Value for On" and "Data Value for Off" options?

To set the value in code, you should be able to use the data window control function dw_whatever.SetItem(row,column,value).

When you refer to "try to save", are you updating an existing row or inserting a new row?
 
Yes the data values are set to N and Y. This error only seems to occur when I try to update an existing record and not when I create a new one. Thanks.
 
Do you perform an accepttext prior to save?

Matt

"Nature forges everything on the anvil of time
 
Yes, in the pfc_update there is a call to the pfc_update in the ancestor but the save is not getting this far. Code is:
SUPER:EVENT pfc_update(boolean1,boolean2). I get these errors before it gets to this code. Thanks
 
Have you tried programatically setting your default value with a setitem call when the row is added/inserted?

Matt

"Nature forges everything on the anvil of time
 
This is for updates only the intial value is working for new records so I don't get this error when I add only when I update. It seems to be associated to the field being a checkbox. If i change to an edit box then I don't get this error!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top