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 » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Set Mytable = MyDB.OpenRecordset



 
 
Thread Tools Display Modes
  #1  
Old March 2nd, 2010, 11:41 PM posted to microsoft.public.access.tablesdbdesign
Tom[_51_]
external usenet poster
 
Posts: 16
Default Set Mytable = MyDB.OpenRecordset

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??








  #2  
Old March 3rd, 2010, 01:02 AM posted to microsoft.public.access.tablesdbdesign
Allen Browne
external usenet poster
 
Posts: 11,706
Default Set Mytable = MyDB.OpenRecordset

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" wrote in message
...
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??








  #3  
Old March 3rd, 2010, 01:19 AM posted to microsoft.public.access.tablesdbdesign
Tom[_51_]
external usenet poster
 
Posts: 16
Default Set Mytable = MyDB.OpenRecordset

Just figured it out... thanks much

"Allen Browne" wrote in message
...
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" wrote in message
...
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??










  #5  
Old March 3rd, 2010, 06:00 AM posted to microsoft.public.access.tablesdbdesign
Allen Browne
external usenet poster
 
Posts: 11,706
Default Set Mytable = MyDB.OpenRecordset

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" wrote in message
...
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??


  #6  
Old March 3rd, 2010, 07:09 PM posted to microsoft.public.access.tablesdbdesign
Steve[_77_]
external usenet poster
 
Posts: 1,017
Default Set Mytable = MyDB.OpenRecordset

Yes I did. Thank you!


"Allen Browne" wrote in message
...
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" wrote in message
...
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??




  #7  
Old March 3rd, 2010, 07:14 PM posted to microsoft.public.access.tablesdbdesign
John... Visio MVP
external usenet poster
 
Posts: 900
Default Set Mytable = MyDB.OpenRecordset

and you also missed the concept that these newsgroups are not provided so
you can ply your questionable services.

John...
"Steve" wrote in message
...
Yes I did. Thank you!


"Allen Browne" wrote in message
...
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" wrote in message
...
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??






 




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:19 AM.


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