Pend save of bound control values

jjturner

Registered User.
Local time
Today, 21:39
Joined
Sep 1, 2002
Messages
386
A dilemma has arisen while designing a UI bound to an underlying table. The 'Allow Zero Length' property for the fields in the table is set to 'NO'. Another dept has ownership of the table, so I can't alter the field properties.

I'm trying to build some integrity into the UI by forcing the users to click <Edit Current Record> button before they can update a record (turning 'Allow Edits' property on). When they've made their updates, there's a <Submit Updates> button option and a <Clear Updates> button option.

The problem is (whether they're adding a new record or editing an existing one) if the underlying field had previously been blank, but the user populated the associated control with data, I can't clear their updates due to the 'Allow Zero Length'=NO setting if they choose <Clear Updates>.

So, 2 general solutions occur to me, but I don't know if either are ideal. (1) Temporarily set 'RecordSource' = "" during update, or (2) Implement the 'BeginTrans'/'CommitTrans'/'Rollback' methods (I suspect these transaction methods don't lend themselves to a multi-user environment).

Any ideas on how to tackle this would be greatly appreciated.

Regards,
John
 
I'll try that (I usually start by thinking of the most complicated solutions and only eventually work my way down to the simplest). I'll have to wait until Monday to try it out, though. I have a bunch of 'IsNull' conditional statements so I may have to rework some code.

Many Thanks,
John
 
Try this Module - It creates a new function called IsNothing()
It's a better function than IsNull()

Function IsNothing(varToTest As Variant) As Integer
' Tests for a "logical" nothing based on data type
' Empty and Null = Nothing
' Number = 0 is Nothing
' Zero length string is Nothing
' Date/Time is never Nothing

IsNothing = True

Select Case VarType(varToTest)
Case vbEmpty
Exit Function
Case vbNull
Exit Function
Case vbBoolean
If varToTest Then IsNothing = False
Case vbByte, vbInteger, vbLong, vbSingle, vbDouble, vbCurrency
If varToTest <> 0 Then IsNothing = False
Case vbDate
IsNothing = False
Case vbString
If (Len(varToTest) <> 0 And varToTest <> " ") Then IsNothing = False
End Select

End Function



Dave Eyley
 
Dave,

Thanks again! - this function will sure come in handy. I'll be finally free from all those hours of trying to test and distinguish between Null, Empty, etc.

Now what will I do with all that extra time?

Regards,
John
 

Users who are viewing this thread

Back
Top Bottom