Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

IF statement + link

Hi all,

in a database I have records with a field called PDF.

This field is either empty or not, if it is not empty, then a path to a .pdf file on the server should be shown using a .pdf icon. Using this code:

[green]<%
If PDF <> "" Then
response.write ("LINK")
Else
response.write ("")
End If
%>
[/green]

I am able to see if the field is empty or not, but thats it. My code to show a link to the file on the server is as follows:

[green]" target="_blank">[/green]

which works fine outside an IF-statement.[hr] How can I get this to work from within the IF-statement?!

Many thanks,

Phil

Comments

  • faustinegeorgefaustinegeorge Member Posts: 351
    I guess your if check isn't working.Is your PDF field a number ? Pls check if there's some other way to check whether a field is NULL other than *If PDF <> "" *.

    faustine
    --------
    : Hi all,
    :
    : in a database I have records with a field called PDF.
    :
    : This field is either empty or not, if it is not empty, then a path to a .pdf file on the server should be shown using a .pdf icon. Using this code:
    :
    : [green]<%
    : If PDF <> "" Then
    : response.write ("LINK")
    : Else
    : response.write ("")
    : End If
    : %>
    : [/green]
    :
    : I am able to see if the field is empty or not, but thats it. My code to show a link to the file on the server is as follows:
    :
    : [green]" target="_blank">[/green]
    :
    : which works fine outside an IF-statement.[hr] How can I get this to work from within the IF-statement?!
    :
    : Many thanks,
    :
    : Phil
    :
    :

  • patfanpatfan Member Posts: 2
    Hi faustine,

    thanks for your message.

    The check in the first part of the code works just fine. The problem I have is implementing the .pdf icon depending on whether the field PDF is empty or not. The PDF field is not a number, it's the path where the file is located if present.

    With the second code, I can create a .pdf icon which links itself to the file shown in the record (PDF field), but within the IF-statement, it will not work, and that's my problem! Both code's work fine alone, (the first code is just to show what I want to accomplish) but I would like a way to display an icon, depending whether the field PDF is empty or not.

    Take care,

    Phil
    : I guess your if check isn't working.Is your PDF field a number ? Pls check if there's some other way to check whether a field is NULL other than *If PDF <> "" *.
    :
    : faustine
    : --------
    : : Hi all,
    : :
    : : in a database I have records with a field called PDF.
    : :
    : : This field is either empty or not, if it is not empty, then a path to a .pdf file on the server should be shown using a .pdf icon. Using this code:
    : :
    : : [green]<%
    : : If PDF <> "" Then
    : : response.write ("LINK")
    : : Else
    : : response.write ("")
    : : End If
    : : %>
    : : [/green]
    : :
    : : I am able to see if the field is empty or not, but thats it. My code to show a link to the file on the server is as follows:
    : :
    : : [green]" target="_blank">[/green]
    : :
    : : which works fine outside an IF-statement.[hr] How can I get this to work from within the IF-statement?!
    : :
    : : Many thanks,
    : :
    : : Phil

  • faustinegeorgefaustinegeorge Member Posts: 351
    okay,Now I almost get the picture.I am not actually a pro. in this,but if i get to know of some way,i will let you know.
    And if you solve it,pls. post it.I wouold like to know.
    keep good
    faustine
    --------

    : Hi faustine,
    :
    : thanks for your message.
    :
    : The check in the first part of the code works just fine. The problem I have is implementing the .pdf icon depending on whether the field PDF is empty or not. The PDF field is not a number, it's the path where the file is located if present.
    :
    : With the second code, I can create a .pdf icon which links itself to the file shown in the record (PDF field), but within the IF-statement, it will not work, and that's my problem! Both code's work fine alone, (the first code is just to show what I want to accomplish) but I would like a way to display an icon, depending whether the field PDF is empty or not.
    :
    : Take care,
    :
    : Phil
    : : I guess your if check isn't working.Is your PDF field a number ? Pls check if there's some other way to check whether a field is NULL other than *If PDF <> "" *.
    : :
    : : faustine
    : : --------
    : : : Hi all,
    : : :
    : : : in a database I have records with a field called PDF.
    : : :
    : : : This field is either empty or not, if it is not empty, then a path to a .pdf file on the server should be shown using a .pdf icon. Using this code:
    : : :
    : : : [green]<%
    : : : If PDF <> "" Then
    : : : response.write ("LINK")
    : : : Else
    : : : response.write ("")
    : : : End If
    : : : %>
    : : : [/green]
    : : :
    : : : I am able to see if the field is empty or not, but thats it. My code to show a link to the file on the server is as follows:
    : : :
    : : : [green]" target="_blank">[/green]
    : : :
    : : : which works fine outside an IF-statement.[hr] How can I get this to work from within the IF-statement?!
    : : :
    : : : Many thanks,
    : : :
    : : : Phil
    :
    :

  • Justin BibJustin Bib USAMember Posts: 0

    // http://forcoder.org // free video tutorials and ebooks about / Scratch C C# Python PHP Ruby Go Delphi JavaScript MATLAB C++ Objective-C R Swift Perl Assembly Visual Basic Visual Basic .NET PL/SQL Java Scheme VBScript Logo ABAP Erlang Bash Clojure LabVIEW Dart Prolog Awk Hack Lua Julia Ada Scala D FoxPro Kotlin Lisp Transact-SQL ML Alice F# Fortran COBOL Apex Rust SAS Crystal / ___________

Sign In or Register to comment.