Can't edit form data from stored procedure

D

Dave

I am having an issue with editing data in my form that is retrieved from a
stored procedure via ADO. I have narrowed the problem down to how the stored
procedure returns the data which I find very odd. When the stored procedure
has statements such as isnull([Undistributed_Q1],0.0) AS [Undistributed_Q1] I
can't edit data on the form. If I remove the isnull and just return the field
[Undistributed_Q1] then I can edit the data on the form.

Has anyone seen this and is there some kind of work around?

Also, if I can't do this, how can I modify the null values in the form to be
0?

Thanks in advance for the help.
 
J

John Spencer

Calculated fields cannot be edited.

If you want to display zero when the field is null, you can apply a
number format to the control displaying the value. The fourth argument
to the format is what is displayed when the value is null. That is
display only, the actual value is still null.

#,###;-#,###;0;0

If you want to change the value that is stored to zero, then you will
have to use some VBA code on the form to change the null to zero.
Perhaps the form's current event.

If IsNull(Me.SomeControl) Then
Me.SomeControl = 0
End if

Or perhaps the form's Before Update event would be a better place if you
wanted to update the null value to zero only when the data for the
record is being saved.

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top