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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Invalid Use of Null ! A Simple Form Question Fix?

Status
Not open for further replies.

gbs01

MIS
Jun 2, 2003
73
US
My code below keeps giving me the ERROR 94 : Invalid Null.
The debugger highlights : strSong = Me!txtSong

-------- Heres my code --------
Code:
Private Sub OLEUnbound122_Click()
Dim strPrefix As String, strSuffix As String, strSong As String
strPrefix = "[URL unfurl="true"]http://shop.gospeland.com/gospeland/advSearch.asp?mode=search&txtTitle="[/URL]
strSong = Me!txtSong
Code:
strSuffix = "&selQuickSearch=SongTitle&Submit1=Search"
    Application.FollowHyperlink strPrefix & strSong & strSuffix, , True
End Sub
---------------------------------

Question : What do I need to add to that line to make it accept the text entered into txtSong & perform the search?

Thanks in advance!
Jerry
 
Hi

You can probably "make it work" by using:

strSong = Nz(Me!txtSong," ")

But you say "make it accept the text entered into txtSong ", the implication of the error is that there is no text (ie null) in txtSong, you could confirm this when it stops by hovering the mosue over txtSong in the code, or by typing ? Me.txtSong in the debug window, the real question then is why is txtSong empty when you expect it to have a value ?


Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Ken, Thanks for the Reply!

txtSong is a Search Box that allows the user to enter part of a song they are seaching for. I have the OLEUnbound122 button coded, that when clicked once, it runs the code I posted.

Your solution did fix the NULL problem! Thanks!

I entered a song title, clicked on my GO button in my Access form & the web page opened to display the search results.

I then closed the browser window, went back to my Access form, back-spaced over that song title & entered a new one. The web page opened again, but displayed the search results for the first song again?

Does the code somehow "SAVE" my first txtSong entry? Why doesn't it use my new title entry, (I typed the new entry in the same box, txtSong? after clearing/backspacing over the old)

I would appreciate your insights again!
Jerry

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top