problem with memo field

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • neelesh kumar
    New Member
    • Mar 2007
    • 44

    #1

    problem with memo field

    sir,

    in my form textboxes named qst,opt1,opt2,o pt3,opt4 are there having control sources(questio n,option1,optio n2,option3,opti on4 which are memo fields) from the tblexam.

    if isnull(qst.valu e) or isnull(opt1.val ue) or isnull(opt2.val ue) or isnull(opt3.val ue) or isnull(opt4.val ue) 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
    .
  • MMcCarthy
    Recognized Expert MVP
    • Aug 2006
    • 14387

    #2
    Deleting data doesn't necessarily set the textbox to null. Try this ...
    Code:
    If IsNull(Me!qst) OR Me!qst = "" _
       OR IsNull(Me!opt1) OR Me!opt1 = "" _
       OR IsNull(Me!opt2) OR Me!opt2 = "" _
       OR IsNull(Me!opt3) OR Me!opt3 = "" _
       OR IsNull(Me!opt4) OR Me!opt4 = "" Then
       
       MsgBox "Invalid"
    
    End If
    Mary

    Comment

    • JConsulting
      Recognized Expert Contributor
      • Apr 2007
      • 603

      #3
      Originally posted by neelesh kumar
      sir,

      in my form textboxes named qst,opt1,opt2,o pt3,opt4 are there having control sources(questio n,option1,optio n2,option3,opti on4 which are memo fields) from the tblexam.

      if isnull(qst.valu e) or isnull(opt1.val ue) or isnull(opt2.val ue) or isnull(opt3.val ue) or isnull(opt4.val ue) 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

      Code:
      If nz(Me!qst,"") = "" OR nz(Me!opt1,"") = "" OR nz(Me!opt2,"") = "" OR nz(Me!opt3,"") = "" OR nz(Me!opt4,"") = "" Then
         MsgBox "Invalid"
      End If

      Comment

      • MMcCarthy
        Recognized Expert MVP
        • Aug 2006
        • 14387

        #4
        Originally posted by JConsulting
        Alternatively
        J

        Code:
        If nz(Me!qst,"") = "" OR nz(Me!opt1,"") = "" OR nz(Me!opt2,"") = "" OR nz(Me!opt3,"") = "" OR nz(Me!opt4,"") = "" Then
           MsgBox "Invalid"
        End If
        Doh!

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

        Mary

        Comment

        • JConsulting
          Recognized Expert Contributor
          • Apr 2007
          • 603

          #5
          Originally posted by mmccarthy
          Doh!

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

          Mary
          anytime :)
          J

          Comment

          Working...