Results 1 to 9 of 9

Thread: Which is correct? SOLVED

  1. #1

    Thread Starter
    Addicted Member Bazzlad's Avatar
    Join Date
    Jun 2003
    Posts
    227

    Which is correct? SOLVED

    For a blank text box....which is the correct way?

    blah blah on click

    if

    A) text6.value = false
    B) text6.value = Null
    C) text6.value = 0

    then

    Etc

    A B or C?
    or is there another?
    Last edited by Bazzlad; Jul 1st, 2003 at 07:22 AM.
    *And you'll see, Everything you stand for is fake*
    http://www.rhesusrock.com

  2. #2
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    I think generally the preferred way is to set the text property to a blank string, null does not mean the same thing...

    Text1.Text = ""

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  3. #3

    Thread Starter
    Addicted Member Bazzlad's Avatar
    Join Date
    Jun 2003
    Posts
    227
    that wont work for reasons...which i should have explained!!! doh!

    the text box itself is hidden and takes its value from a combobox

    and you can't reference a property unless it has the focus
    *And you'll see, Everything you stand for is fake*
    http://www.rhesusrock.com

  4. #4
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863
    Hi, alex
    he asked the same in the general section.
    on the original question your suggestion was correct (Check for =""), but he had other problems too...........
    I tried to help for some length, but ...
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  5. #5
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    Okay thank Opus , Bazzlad - you're gonna have to paste a sample up please mate - I can't re-create any problems trying this at the moment...

    Attached Files Attached Files

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  6. #6

    Thread Starter
    Addicted Member Bazzlad's Avatar
    Join Date
    Jun 2003
    Posts
    227
    At work so can't put things up however
    http://www.vbforums.com/showthread.p...hreadid=251711
    this explains it....
    it comes down to the correct way of making a multiple if statement, and if a blank text box can be tested on .value = false
    Thanx for helping
    *And you'll see, Everything you stand for is fake*
    http://www.rhesusrock.com

  7. #7
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    Got it, ahh you're playing with Access too, fine I'll take a quick look...

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  8. #8
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    ahh okay looks like I was wrong - you can't use the text property in this case...
    http://www.tek-tips.com/gviewthread....705/qid/418638

    This one seems to work for me:
    Attached Files Attached Files

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  9. #9

    Thread Starter
    Addicted Member Bazzlad's Avatar
    Join Date
    Jun 2003
    Posts
    227

    GOT IT!

    Thanks Alex,
    I read your post just as I figured it...



    Private Sub Command8_Click()
    On Error GoTo Err_Command8_Click

    If Text6.Value = False Then
    responce = MsgBox("Enter a Customer Name", vbOKOnly, "You messed up!")
    Else
    GoTo 10
    Exit Sub

    10
    If IMEI.Value >= "" Then
    GoTo 20
    Else: responce = MsgBox("Enter an IMEI Number", vbOKOnly, "You messed up!")
    Exit Sub

    20
    If Make.Value >= "" Then
    GoTo 30
    Else: responce = MsgBox("Enter an Phone Make", vbOKOnly, "You messed up!")
    Exit Sub

    30
    Dim stDocName As String
    Dim stLinkCriteria As String
    Me.Visible = False
    stDocName = "frmrepair"

    DoCmd.OpenForm stDocName, , , stLinkCriteria
    stDocName = "frmrepair"
    DoCmd.OpenForm stDocName, , , stLinkCriteria
    DoCmd.GoToRecord , , acNewRec
    [Forms]![frmrepair]![Text14] = [Forms]![frmphone]![IMEI]
    [Forms]![frmrepair]![Customer Name] = [Forms]![frmphone]![Text6]
    [Forms]![frmrepair]![Check25] = [Forms]![frmphone]![Warranty]


    End If
    End If
    End If

    Exit_Command8_Click:
    Exit Sub

    Err_Command8_Click:
    MsgBox Err.Description
    Resume Exit_Command8_Click

    End Sub



    What I don't get is why I have to make text6.value = false
    and the others .value >= ""
    and if I try to swap them round they won't work, but I'm not complaining! It works!
    *And you'll see, Everything you stand for is fake*
    http://www.rhesusrock.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width