Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2004
    Posts
    52

    Unanswered: guy who knows diddly about vb needs some assistance!!!

    I want to write an if statement that inserts a null value if ther isn't anyhitng enetered into a feild i generated. This field is called: type of conference.

    This is what i have so far:

    if isnull([Forms]![frmAttendenceSearch]![Conference])
    then
    basConference = Null
    else
    basConference = ([Forms]![frmAttendenceSearch]![Conference])
    end if


    can i get some feed back on this attempt.

  2. #2
    Join Date
    Mar 2004
    Posts
    52

    Re: guy who knows diddly about vb needs some assistance!!!

    one more thing basconference is defined as

    Functions basConference as variant

    basConference = Nz(([Forms]![frmAttendenceSearch]![Conference]))

    End Function


    Originally posted by ax2ron
    I want to write an if statement that inserts a null value if ther isn't anyhitng enetered into a feild i generated. This field is called: type of conference.

    This is what i have so far:

    if isnull([Forms]![frmAttendenceSearch]![Conference])
    then
    basConference = Null
    else
    basConference = ([Forms]![frmAttendenceSearch]![Conference])
    end if


    can i get some feed back on this attempt.

  3. #3
    Join Date
    Mar 2004
    Posts
    6

    Re: guy who knows diddly about vb needs some assistance!!!

    Originally posted by ax2ron
    one more thing basconference is defined as

    Functions basConference as variant

    basConference = Nz(([Forms]![frmAttendenceSearch]![Conference]))

    End Function
    Have you tried "" instead of Null?

  4. #4
    Join Date
    Mar 2004
    Posts
    52

    Re: guy who knows diddly about vb needs some assistance!!!

    my code is giving me a syntax error, the first two lines are highlighted in red. What gives?



    Originally posted by slvanya
    Have you tried "" instead of Null?

  5. #5
    Join Date
    Mar 2004
    Posts
    6

    then must be on same line

    The "then" must be on the same line.

    If IsNull([Forms]![frmAttendenceSearch]![Conference]) Then
    basConference = Null
    Else
    basConference = ([Forms]![frmAttendenceSearch]![Conference])
    End If

    My suggestion of "" is wrong. (checked help file).

    Also, a ? . Is the field is already null, i.e. IsNull returns True, why do you want to set it to null?

    ? what do you want to do with the field?

    (I'm a newbie, to helping on a forum)

  6. #6
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713

    Re: guy who knows diddly about vb needs some assistance!!!

    Originally posted by ax2ron
    I want to write an if statement that inserts a null value if ther isn't anyhitng enetered into a feild i generated. This field is called: type of conference.

    This is what i have so far:

    if isnull([Forms]![frmAttendenceSearch]![Conference])
    then
    basConference = Null
    else
    basConference = ([Forms]![frmAttendenceSearch]![Conference])
    end if


    can i get some feed back on this attempt.
    First off ... What and where is basConference? Column name of a table? Global Variable? Local?

Posting Permissions

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