G
Guest
Hi there,
I'm working on a Access2000 form ; the form is used to fill
data in a linked SQL Server table ; I've two problems :
1. Textbox : I'm trying to check the value entered by the user
in a textbox using a simple if cycle as follow:
...
if mytextbox.value is null then msgbox("error")
...
It happens that if the value is null the if condition
doesn't work and my msgbox doesn't appear ;
I'm sure it is null because I add an expression control to watch this control.
It also doesn't work if I exchange in the condition the 'null' with "" or 0.
The only way I've seen it works is to check the property text, but in that
case I need the control to be active before, but this is a bad solution as
my form every time I use the setfocus method jump from a control to another...
What's the problem?
2. I'm trying to trap errors coming from my MSDE server when the user does not
respect the validation rule of a certain field : I'm able to see the error and the
description trapping the ODBC error but the description is full of data; I just
need to have for example the name of the field where the data is not correct ;
so , how can read the native SQL Server error code & description from
the form code?
Thank you in advance,
Renato
I'm working on a Access2000 form ; the form is used to fill
data in a linked SQL Server table ; I've two problems :
1. Textbox : I'm trying to check the value entered by the user
in a textbox using a simple if cycle as follow:
...
if mytextbox.value is null then msgbox("error")
...
It happens that if the value is null the if condition
doesn't work and my msgbox doesn't appear ;
I'm sure it is null because I add an expression control to watch this control.
It also doesn't work if I exchange in the condition the 'null' with "" or 0.
The only way I've seen it works is to check the property text, but in that
case I need the control to be active before, but this is a bad solution as
my form every time I use the setfocus method jump from a control to another...
What's the problem?
2. I'm trying to trap errors coming from my MSDE server when the user does not
respect the validation rule of a certain field : I'm able to see the error and the
description trapping the ODBC error but the description is full of data; I just
need to have for example the name of the field where the data is not correct ;
so , how can read the native SQL Server error code & description from
the form code?
Thank you in advance,
Renato