Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Working with NULL Values 1

Status
Not open for further replies.

jedel

Programmer
Jan 11, 2003
430
AU
Hi All

I have a Form where student fill out to express and interest in studying with our organisation. This foprm records their local IP address using the LOCAL_ADDR server variable.

I then have a select query on the page where it selects the records based on a session variable of the LOCAL_ADDR Server Variable.

The idea being, if the prospective student has been to this page before, it will display a form with their details already in it and the form will just update the database. If the prospective student has not been to this page, then a blank form will appear and a new record is added to the database.

The problem lies with the new student, seeing as their IP Address will not show up in the database, the Select query will not turn up any records. I want to use this "NULL" value to bring up the blank form. The code looks like this:

Code:
<%  IF CollInt.Fields.Item("Name").value & " " <> ""  Then%>
<FORM DETAIL HERE TO UPDATE RECORDS>
<%Else%>
<BLANK FORM HERE>
<% End IF%>
No matter what I try, I still end up the the BOF or EOF error.

My question is how can I deal with the NULL value to get the correct form to appear?

-------------------------------------------------------------
"The most overlooked advantage of owning a computer is that if they foul up there's no law against whacking them around a bit."
 
Why not just use the EOF as a test? Assuming that CollInt is your query, try:
Code:
<%  IF CollInt.EOF Then%>
<BLANK FORM HERE>
<%Else%>
<FORM DETAIL HERE TO UPDATE RECORDS>
<% End IF%>

___________________________________________________________
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
Steam Engine Prints
 
Johnwm

You're a legend. Thanks heaps for that. You've opened up some more ideas for me.

Cheers

Dean

-------------------------------------------------------------
"The most overlooked advantage of owning a computer is that if they foul up there's no law against whacking them around a bit."
 
You're welcome [smile]

___________________________________________________________
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
Steam Engine Prints
 
Chris - I suspect you will still get a EOF type error if the recordset is empty rather than just the field being null.

___________________________________________________________
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
Steam Engine Prints
 
You will,

Having a background in Access programing where you can use this, it was one of the first things I tried. Came up with the EOF BOF Error

-------------------------------------------------------------
"The most overlooked advantage of owning a computer is that if they foul up there's no law against whacking them around a bit."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top