A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Command Button Failure...



 
 
Thread Tools Display Modes
  #1  
Old September 4th, 2006, 07:04 PM posted to microsoft.public.access.forms
Heidelberg
external usenet poster
 
Posts: 30
Default Command Button Failure...


For some reason when I try to creat a command button on my form it gives a
beep and displays the following message: "Object variable or with block
variable not set"

It also doesn't allow me to continue, so I'm stuck until I figure out what's
wrong...

Any ideas?

Thanks!

  #2  
Old September 4th, 2006, 08:07 PM posted to microsoft.public.access.forms
J. Goddard
external usenet poster
 
Posts: 159
Default Command Button Failure...

Usually that's a problem with your VB code; often referring to a
recordset that has been closed or not opened yet. Does the error
message give you an option to debug?


John


Heidelberg wrote:
For some reason when I try to creat a command button on my form it gives a
beep and displays the following message: "Object variable or with block
variable not set"

It also doesn't allow me to continue, so I'm stuck until I figure out what's
wrong...

Any ideas?

Thanks!


  #3  
Old September 5th, 2006, 11:41 AM posted to microsoft.public.access.forms
Heidelberg
external usenet poster
 
Posts: 30
Default Command Button Failure...

Thanks for responding so quickly!

No options are given to debug... just the beep and message!

The problem is that it also freezes any progress on that form...

What should I be looking for in the VB?

Heidelberg



"J. Goddard" wrote:

Usually that's a problem with your VB code; often referring to a
recordset that has been closed or not opened yet. Does the error
message give you an option to debug?


John


Heidelberg wrote:
For some reason when I try to creat a command button on my form it gives a
beep and displays the following message: "Object variable or with block
variable not set"

It also doesn't allow me to continue, so I'm stuck until I figure out what's
wrong...

Any ideas?

Thanks!



  #4  
Old September 6th, 2006, 12:31 AM posted to microsoft.public.access.forms
J. Goddard
external usenet poster
 
Posts: 159
Default Command Button Failure...

Hi -

check for references to a recordset (rst.movefirst, rst.BOF,
rst!fieldname, etc) that occur either before the recordset has been
opened with set rst=db.openrecordset OR after the recordet has been
closed with rst.close .

or

You will also get this error if when you execute rst=db.openrecordset,
the db object has not yet been defined with set db=.... OR has been
released with set db = Nothing

OR

You are using a "With" type of syntax (.movefirst, .EOF, .fieldname)
without having used "with rst" first:

With rst
..
..
..
End With

These are the commonest situations I have encountered; there may be
others. If you don't find the problem, post the code that runs when the
command button is clicked.

John


Heidelberg wrote:
Thanks for responding so quickly!

No options are given to debug... just the beep and message!

The problem is that it also freezes any progress on that form...

What should I be looking for in the VB?

Heidelberg



"J. Goddard" wrote:


Usually that's a problem with your VB code; often referring to a
recordset that has been closed or not opened yet. Does the error
message give you an option to debug?


John


Heidelberg wrote:

For some reason when I try to creat a command button on my form it gives a
beep and displays the following message: "Object variable or with block
variable not set"

It also doesn't allow me to continue, so I'm stuck until I figure out what's
wrong...

Any ideas?

Thanks!




 




Thread Tools
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
Forum Jump


All times are GMT +1. The time now is 12:51 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.