p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > Microsoft Office > Access and Access VBA > Access
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.

Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 31st, 2006, 09:49 AM
Authorized User
 
Join Date: Aug 2005
Location: , , .
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default Object Required Error

I have a form that opens another form when a command button is clicked. This newly opened form has this code on load:

Private Sub Form_Load()
 If [Forms]![frmCDs]![luwSoftware].Value Is Not Null Then
    List1.RowSource = "qrySW6"
    ElseIf [Forms]![frmCDs]![luwSoftware].Value Is Null Then
    List1.RowSource = "qrySW"
 End If
End Sub

It keeps returning the "Object Required" error message. frmCDs!luwSoftware exists... so I'm confused as to why this won't work.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old July 31st, 2006, 09:54 AM
Friend of Wrox
Points: 1,371, Level: 14
Points: 1,371, Level: 14 Points: 1,371, Level: 14 Points: 1,371, Level: 14
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2004
Location: Clinton, UT, USA.
Posts: 564
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Jeff,

I was struggling with something like this yesterday. I think what ended up working was something in the format...

Forms!frmCDs.luwSoftware.Value Is Not Null Then

If that doesn't work, try just...

Forms!frmCDs.luwSoftware Is Not Null Then

And if that doesn't work we could try some other things.

Mike

Mike
EchoVue.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old July 31st, 2006, 09:58 AM
Authorized User
 
Join Date: Aug 2005
Location: , , .
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Neither of those worked. But it will work if I use, say:

Forms!frmCDs!luwSoftware.Value = 7 Then

So I'm thinking maybe it doesn't like the null thing. Any ideas?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #4 (permalink)  
Old July 31st, 2006, 10:04 AM
Authorized User
 
Join Date: Aug 2005
Location: , , .
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Silly me. Is Not Null is a SQL thing, and is not recognized by VBA. Instead, I had to use IsNull().

Private Sub Form_Load()
 If IsNull(Forms!frmCDs!luwSoftware.Value) = False Then
    List1.RowSource = "qrySW6"
    ElseIf IsNull([Forms]![frmCDs].[luwSoftware]) = True Then
    List1.RowSource = "qrySW"
 End If
End Sub

There we go. Thanks anyway Mike.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #5 (permalink)  
Old October 1st, 2009, 07:08 AM
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I too just wanted to say thank you. Looking at my code, adding better handling etc did not help. I too had used the SQL code instead of th VBA.

I'm soooo pleased to move on...
Ta very much!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #6 (permalink)  
Old October 2nd, 2009, 09:09 AM
Friend of Wrox
Points: 3,645, Level: 25
Points: 3,645, Level: 25 Points: 3,645, Level: 25 Points: 3,645, Level: 25
Activity: 2%
Activity: 2% Activity: 2% Activity: 2%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,114
Thanks: 2
Thanked 4 Times in 4 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Simplified, it would be

Code:
Private Sub Form_Load()
 
    If IsNull(Forms.frmCDs.Form.luwSoftware) Then
        Me.List1.RowSource = "qrySW"
    Else
        Me.List1.RowSource = "qrySW6"
    End If
 
End Sub
__________________
Greg Serrano
Michigan Dept. of Environmental Quality
Air Quality Division
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Object Required error voyeur Javascript 9 January 25th, 2008 11:50 AM
Compile Error: Object required DeannaF829 Beginning VB 6 1 April 24th, 2007 08:12 AM
MSXML Object Required Error??? kevorkian Classic ASP Basics 1 January 5th, 2007 12:43 PM
Object required error ?? hman SQL Server ASP 11 June 21st, 2004 11:59 AM
error....Object required: '' sassenach Classic ASP Databases 2 August 4th, 2003 04:27 PM



All times are GMT -4. The time now is 12:17 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc