From: Tom on
Help,

I am not much of a programmer, but I have managed to build a fairly good
tool.



The original code was written in 2003 but upon the conversion to 2007, I get
a Type Mismatch on the following code.



Const ProductTable = "Products"

Dim MyTable As Recordset

Dim MyDB As Database

Dim PNHolder As String





Set MyDB = CurrentDb()

Set MyTable = MyDB.OpenRecordset(ProductTable) ---�<<< Error appears
here??








From: Allen Browne on
Try:
Dim MyTable As DAO.Recordset

Multiple libraries have a Recordset object. More info:
http://allenbrowne.com/ser-38.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"Tom" <Tom.Weissgerber(a)intel.com> wrote in message
news:ux$OzlluKHA.812(a)TK2MSFTNGP06.phx.gbl...
> Help,
>
> I am not much of a programmer, but I have managed to build a fairly good
> tool.
>
>
>
> The original code was written in 2003 but upon the conversion to 2007, I
> get a Type Mismatch on the following code.
>
>
>
> Const ProductTable = "Products"
>
> Dim MyTable As Recordset
>
> Dim MyDB As Database
>
> Dim PNHolder As String
>
>
>
>
>
> Set MyDB = CurrentDb()
>
> Set MyTable = MyDB.OpenRecordset(ProductTable) ---�<<< Error appears
> here??
>
>
>
>
>
>
>
>
From: Tom on
Just figured it out... thanks much

"Allen Browne" <AllenBrowne(a)SeeSig.Invalid> wrote in message
news:uiXLiTmuKHA.1796(a)TK2MSFTNGP02.phx.gbl...
> Try:
> Dim MyTable As DAO.Recordset
>
> Multiple libraries have a Recordset object. More info:
> http://allenbrowne.com/ser-38.html
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
>
> "Tom" <Tom.Weissgerber(a)intel.com> wrote in message
> news:ux$OzlluKHA.812(a)TK2MSFTNGP06.phx.gbl...
>> Help,
>>
>> I am not much of a programmer, but I have managed to build a fairly good
>> tool.
>>
>>
>>
>> The original code was written in 2003 but upon the conversion to 2007, I
>> get a Type Mismatch on the following code.
>>
>>
>>
>> Const ProductTable = "Products"
>>
>> Dim MyTable As Recordset
>>
>> Dim MyDB As Database
>>
>> Dim PNHolder As String
>>
>>
>>
>>
>>
>> Set MyDB = CurrentDb()
>>
>> Set MyTable = MyDB.OpenRecordset(ProductTable) ---�<<< Error appears
>> here??
>>
>>
>>
>>
>>
>>
>>
>>


From: Steve on
Hello Tom,

ProductTable needs to be enclosed inside double quotes.

Steve
santus(a)penn.com


"Tom" <Tom.Weissgerber(a)intel.com> wrote in message
news:ux$OzlluKHA.812(a)TK2MSFTNGP06.phx.gbl...
> Help,
>
> I am not much of a programmer, but I have managed to build a fairly good
> tool.
>
>
>
> The original code was written in 2003 but upon the conversion to 2007, I
> get a Type Mismatch on the following code.
>
>
>
> Const ProductTable = "Products"
>
> Dim MyTable As Recordset
>
> Dim MyDB As Database
>
> Dim PNHolder As String
>
>
>
>
>
> Set MyDB = CurrentDb()
>
> Set MyTable = MyDB.OpenRecordset(ProductTable) ---�<<< Error appears
> here??
>
>
>
>
>
>
>
>


From: Allen Browne on
Steve, I think you missed the constant declaration on the first line of his
code.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"Steve" <notmyemail(a)address.com> wrote in message
news:ue#TKymuKHA.3408(a)TK2MSFTNGP06.phx.gbl...
> ProductTable needs to be enclosed inside double quotes.
>>
>> Const ProductTable = "Products"
>> Dim MyTable As Recordset
>> Dim MyDB As Database
>> Dim PNHolder As String
>>
>> Set MyDB = CurrentDb()
>> Set MyTable = MyDB.OpenRecordset(ProductTable) ---�<<< Error
>> appears here??