473,387 Members | 1,834 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,387 software developers and data experts.

Idiot question

Hi

Could someone tell me what is wrong here? I'm using Access 2000 and a class
module. The table is called "tblSource"

For some reason the following code generates a "Run-time error 13: type
mismatch" error and I just can't see why.
Public Function getdata()
Dim rstSource As Recordset
Set rstSource = CurrentDb.OpenRecordset("tblSource")
End Function

It can't be that hard, yet I keep getting errors. Can someone tell me what I
am doing wrong?

The table tblSource has only 2 columns, an autonumber key field and a double
numeric.

Manning
Nov 12 '05 #1
2 1435
You might try:

Public Function getdata()
Dim rstSource As DAO.Recordset
Set db = CurrentDb
Set rstSource = db.OpenRecordset("tblSource")
End Function
"Manning" <ma*****@NOSPAMbartlett.net> wrote in message
news:bq**********@lust.ihug.co.nz...
Hi

Could someone tell me what is wrong here? I'm using Access 2000 and a class module. The table is called "tblSource"

For some reason the following code generates a "Run-time error 13: type
mismatch" error and I just can't see why.
Public Function getdata()
Dim rstSource As Recordset
Set rstSource = CurrentDb.OpenRecordset("tblSource")
End Function

It can't be that hard, yet I keep getting errors. Can someone tell me what I am doing wrong?

The table tblSource has only 2 columns, an autonumber key field and a double numeric.

Manning

Nov 12 '05 #2
This is assuming you already have a reference to DAO selected. If not, in a
code window, select Tools | References. Make sure you have selected
"Microsoft DAO 3.5 Object Library". The actual version may vary on your
system.

HTH

Mike Krous

"deko" <dj****@hotmail.com> wrote in message
news:Z9*******************@newssvr29.news.prodigy. com...
You might try:

Public Function getdata()
Dim rstSource As DAO.Recordset
Set db = CurrentDb
Set rstSource = db.OpenRecordset("tblSource")
End Function
"Manning" <ma*****@NOSPAMbartlett.net> wrote in message
news:bq**********@lust.ihug.co.nz...
Hi

Could someone tell me what is wrong here? I'm using Access 2000 and a class
module. The table is called "tblSource"

For some reason the following code generates a "Run-time error 13: type
mismatch" error and I just can't see why.
Public Function getdata()
Dim rstSource As Recordset
Set rstSource = CurrentDb.OpenRecordset("tblSource")
End Function

It can't be that hard, yet I keep getting errors. Can someone tell me

what I
am doing wrong?

The table tblSource has only 2 columns, an autonumber key field and a

double
numeric.

Manning


Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: perseus | last post by:
ath:...
383
by: John Bailo | last post by:
The war of the OSes was won a long time ago. Unix has always been, and will continue to be, the Server OS in the form of Linux. Microsoft struggled mightily to win that battle -- creating a...
11
by: Kevin Grigorenko | last post by:
That's a rethorical question. But shouldn't this statement store the value of three in the variable a: #include <iostream> int main() { int a = 1 & 2; if(a & 1) {
6
by: lkrubner | last post by:
I apologize for my igorance of Regex. I can't get this function to work. It gives the following error message. function checkForFloatingPoint($input=false) { $pattern = "?(*\.+|+)"; $match...
15
by: Daniel Billingsley | last post by:
Speaking of trying to read deeply nested if-else blocks... I often find it's not always easy to tell one indent level from another (granted I keep my tab settings low so I'm not halfway across...
4
by: Bill Dodd | last post by:
Is there really no way to have different asp.net applications share session variables? The problem I'm running into is that I have numerous asp.net (and asp) applications that were written as...
12
by: clintonG | last post by:
I can't tell you how frustrated I get when going to a web developer's website and observing he or she is an idiot that has not grasped the most fundamental element of usability: page title naming...
23
by: novice | last post by:
I dint find a proper group to post this, so i'm asking this question. If you think this question is irrelevent then dont answer, but i expect good replies from experts. I wondor, how these guys...
2
by: Peter Webb | last post by:
I want to use the arbitrary precision integer arithmetic package "IntX", from http://codeplex.com/IntX/ This adds a multiprecision class for integers. I cannot see how to add an external class...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...

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.