By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,515 Members | 1,363 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,515 IT Pros & Developers. It's quick & easy.

problem with memo field

P: 44
sir,

in my form textboxes named qst,opt1,opt2,opt3,opt4 are there having control sources(question,option1,option2,option3,option4 which are memo fields) from the tblexam.

if isnull(qst.value) or isnull(opt1.value) or isnull(opt2.value) or isnull(opt3.value) or isnull(opt4.value) then
msgbox "invalid"

If i click modify button in my form and make any question or option null then message box is not coming.It is not taking as null.
for text fields it is taking as null but for memo fileds in the table it is not taking as null though i cleared the question or option filed.
why
please help me
thanks in advance
.
May 11 '07 #1
Share this Question
Share on Google+
4 Replies


MMcCarthy
Expert Mod 10K+
P: 14,534
Deleting data doesn't necessarily set the textbox to null. Try this ...
Expand|Select|Wrap|Line Numbers
  1. If IsNull(Me!qst) OR Me!qst = "" _
  2.    OR IsNull(Me!opt1) OR Me!opt1 = "" _
  3.    OR IsNull(Me!opt2) OR Me!opt2 = "" _
  4.    OR IsNull(Me!opt3) OR Me!opt3 = "" _
  5.    OR IsNull(Me!opt4) OR Me!opt4 = "" Then
  6.  
  7.    MsgBox "Invalid"
  8.  
  9. End If
  10.  
Mary
May 12 '07 #2

JConsulting
Expert 100+
P: 603
sir,

in my form textboxes named qst,opt1,opt2,opt3,opt4 are there having control sources(question,option1,option2,option3,option4 which are memo fields) from the tblexam.

if isnull(qst.value) or isnull(opt1.value) or isnull(opt2.value) or isnull(opt3.value) or isnull(opt4.value) then
msgbox "invalid"

If i click modify button in my form and make any question or option null then message box is not coming.It is not taking as null.
for text fields it is taking as null but for memo fileds in the table it is not taking as null though i cleared the question or option filed.
why
please help me
thanks in advance
.
Alternatively
J

Expand|Select|Wrap|Line Numbers
  1. If nz(Me!qst,"") = "" OR nz(Me!opt1,"") = "" OR nz(Me!opt2,"") = "" OR nz(Me!opt3,"") = "" OR nz(Me!opt4,"") = "" Then
  2.    MsgBox "Invalid"
  3. End If
  4.  
May 12 '07 #3

MMcCarthy
Expert Mod 10K+
P: 14,534
Alternatively
J

Expand|Select|Wrap|Line Numbers
  1. If nz(Me!qst,"") = "" OR nz(Me!opt1,"") = "" OR nz(Me!opt2,"") = "" OR nz(Me!opt3,"") = "" OR nz(Me!opt4,"") = "" Then
  2.    MsgBox "Invalid"
  3. End If
  4.  
Doh!

I'm too tired to be doing this tonight. How did I miss that. Thanks J.

Mary
May 12 '07 #4

JConsulting
Expert 100+
P: 603
Doh!

I'm too tired to be doing this tonight. How did I miss that. Thanks J.

Mary
anytime :)
J
May 12 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.