Hi,
ok can someone explain me what I am doing wrong :
I got some code to Clear all the Field of a form with subforms
and it goes like that(Btw if there's a easiest/simple way tell me, i'm quite new to vba/access)
now the thing is after I pressed the button that do that ... I do (in another button) a check of the lenght of each acTextbox/acCombobox and the weird things begin : for myControl everything is fine [tt]len(myControl.value)[/tt] returns 0 but weirdly for mysubControl, [tt]len(mySubControl.Value)[/tt] returns 4 I suppose for 'NULL' ... any idea why?!?! (and I need it to return 0! btw I looked into the Debug and put a watch on mySubControl.Value and it's equal to "" but still return 4 as lenght...)
btw i'm using Access 2000 with SQL Server 2000
jul ^_^
"Computer Science is no more about computers than astronomy is about telescopes"
E. W. Dijkstra.
ok can someone explain me what I am doing wrong :
I got some code to Clear all the Field of a form with subforms
and it goes like that(Btw if there's a easiest/simple way tell me, i'm quite new to vba/access)
Code:
For Each myControl In Controls
Select Case myControl.ControlType
Case acTextBox, acComboBox, acCheckBox
myControl.Value = ""
Case acSubform
For Each mySubControl In myControl.Form.Controls
Select Case mySubControl.ControlType
Case acTextBox, acComboBox
mySubControl.Value = ""
End Select
Next
End Select
Next
now the thing is after I pressed the button that do that ... I do (in another button) a check of the lenght of each acTextbox/acCombobox and the weird things begin : for myControl everything is fine [tt]len(myControl.value)[/tt] returns 0 but weirdly for mysubControl, [tt]len(mySubControl.Value)[/tt] returns 4 I suppose for 'NULL' ... any idea why?!?! (and I need it to return 0! btw I looked into the Debug and put a watch on mySubControl.Value and it's equal to "" but still return 4 as lenght...)
btw i'm using Access 2000 with SQL Server 2000
jul ^_^
"Computer Science is no more about computers than astronomy is about telescopes"
E. W. Dijkstra.