473,396 Members | 1,767 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

object variable or with block variable not set

Sub isave()
Me.Adodc1.Recordset.AddNew
Me.Adodc1.Recordset.Fields(0) = txtid.Text
Me.Adodc1.Recordset.Fields(1) = txtregistryno.Text
Me.Adodc1.Recordset.Fields(2) = txtcitymun.Text
Me.Adodc1.Recordset.Fields(3) = txtname.Text
Me.Adodc1.Recordset.Fields(4) = txtage.Text
Me.Adodc1.Recordset.Fields(5) = txtsex.Text
Me.Adodc1.Recordset.Fields(6) = txtreligion.Text
Me.Adodc1.Recordset.Fields(7) = txtdatedeath.Text
Me.Adodc1.Recordset.Fields(8) = txtpdeath.Text
Me.Adodc1.Recordset.Fields(9) = txtresidence.Text
Me.Adodc1.Recordset.Fields(10) = txtcivilstatus.Text
Me.Adodc1.Recordset.Fields(11) = txtoccupation.Text
Me.Adodc1.Recordset.Fields(12) = txtcause.Text
Me.Adodc1.Recordset.Fields(13) = txtbdissue.Text
Me.Adodc1.Recordset.Update
MsgBox "Recod Added Successfully...", vbExclamation
clear
End Sub

Private Sub cmds_Click()
isave
End Sub


it occurs runtime error 91"object variable or with block variable not set"
...i done as much as i could...can any1 help me out
Aug 31 '11 #1
1 1821
Stewart Ross
2,545 Expert Mod 2GB
You do not show where you have initialised the control you have named as adodc1's recordset - you have to have initialised it somewhere via an open connection before you can use it. You are not doing so in your isave sub. Have you done so somewhere else?

What is adodc1 anyway? You do not say.

It would be useful to see the whole context of what you are doing, and to have some information from you about where exactly the error is occurring and what you have done so far to debug the code.

-Stewart
Aug 31 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: RJN | last post by:
Hi Sorry for posting again. I'm calling a shared method in the class. The following error is found in production though I'm not able to reproduce. ...
6
by: Neo Geshel | last post by:
I am trying to deal with an image in code-behind. I consistently get the following error: Server Error in '/' Application. Object variable or With block variable not set. Description: An...
3
by: Richard Hollenbeck | last post by:
I've marked the line in this subroutine where I've been getting this error. It may be something stupid but I've been staring at this error trying to fix it for over an hour. I'm pretty sure the...
9
by: axs221 | last post by:
I am trying to move some of our large VBA Access front-end file into ActiveX DLL files. I created two DLL files so far, one was a module that contains code to integrate into the QuickBooks...
1
by: abhijmenbumca07 | last post by:
Object variable or With block variable not set. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information...
4
by: BrianAdev | last post by:
Why It throw an error of <Object variable or With block variable not set> set objAccess = GetObject(strMdbPath) objAccess.DoCmd.SetWarning False objAccess.DoCmd.OpenReport strReportName, 0 'It...
3
by: Newbie19 | last post by:
I'm trying to get a list of all subfolders in a folder on a share drive, but I keep on getting this error message: Object variable or With block variable not set. Description: An unhandled...
5
by: Al G | last post by:
Hi, I'm converting a bit of POP3 VB6 code to VB2005, and have run into this error with the following code. Can someone help me find out what I'm missing/doing wrong? 'holds the attachments...
0
by: Paul Morriss | last post by:
I get this error from an application: ************** Exception Text ************** System.NullReferenceException: Object variable or With block variable not set. at...
3
adascat
by: adascat | last post by:
Got title problem for the codes below, can anyone help to have a look what's wrong here? Thanks a million. - A newbie Description: An unhandled exception occurred during the execution of the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.