How to stop subform from creating a blank line

JeffreyDavid

Registered User.
Local time
Today, 16:46
Joined
Dec 23, 2003
Messages
63
I have a form with a subform, if the form is opened and closed with no data input, it creates a blank line in the table. Over an extended period of time, that table will be mess.
How would one go about stopping a subform from creating a blank line in the table?
 
this is not a normal event. What's going on in your FORM OPEN event for the sub-form.
 
Kodo said:
this is not a normal event. What's going on in your FORM OPEN event for the sub-form.
There is nothing in the FormOpen event of the subform. My subform does have 3 cascading text boxes. In the BeforeUpdate event, I have
If IsNull(Me.ProjectNo) = "" Then
Cancel = True
End If
But when I close the form with nothing done to anything, I get an error saying 'Type Mismatch' and it refers to line:
If IsNull(Me.ProjectNo) = "" Then

So I don't know...
 
If IsNull(Me.ProjectNo) = "" Then


that is not valid.

you either do

IF ISNULL(ME.PROJECTNO) THEN


or

IF ME.PROJECTNO="" THEN

but not both at the same time.
 
IsNull(Me.ProjectNo) - returns a boolean value which is either -1 (true) or 0 (false). Since it is a numeric value it cannot be compared to a zero length string. Change the If statement to

If IsNull(Me.ProjectNo) Then

Records are being created because you have some code that is dirting the record. Post the code from all the form's events if you can't figure out what is doing it.
 

Users who are viewing this thread

Back
Top Bottom