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  

How do I "Dim db As Database" using a Access App linked to SQL db



 
 
Thread Tools Display Modes
  #1  
Old January 4th, 2006, 07:59 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default How do I "Dim db As Database" using a Access App linked to SQL db

I'm trying to build an unbound MSAccess form to append records to a linked
SQL data table. when I try to set/define the variable using "Dim db As
Database" I get type not found error when I compile the code. Any clues for
me.......TKS....mw
  #2  
Old January 4th, 2006, 09:25 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default How do I "Dim db As Database" using a Access App linked to SQL db

On Wed, 4 Jan 2006 11:59:01 -0800, "Mike"
wrote:

I'm trying to build an unbound MSAccess form to append records to a linked
SQL data table. when I try to set/define the variable using "Dim db As
Database" I get type not found error when I compile the code. Any clues for
me.......TKS....mw


In the VBA editor, select Tools... References. Make sure that
Microsoft DAO x.xx Object Library (highest version) is checked. With
A2000, VBA defaults to selecting the ActiveX Data Objects (ADOX)
library instead.

John W. Vinson[MVP]
  #3  
Old January 5th, 2006, 10:41 AM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default How do I "Dim db As Database" using a Access App linked to SQL db

Further to John's answer it would be a good idea to also
disambiguate your Dim statement thus:-

Dim db as DAO.Database

And any recordsets you declare also using the DAO library:-

Dim rst as DAO.Recordset

--
Nick Coe (UK)
http://www.alphacos.co.uk/ AccHelp + pAnimal
http://www.pjandcoe.co.uk/ Online Store
http://www.mrcomputersltd.com/ Repairs Upgrades

In ,
Mike typed:
I'm trying to build an unbound MSAccess form to append
records
to a linked SQL data table. when I try to set/define the
variable using "Dim db As Database" I get type not found
error when I compile the code. Any clues for
me.......TKS....mw



  #4  
Old January 6th, 2006, 08:12 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default How do I "Dim db As Database" using a Access App linked to SQL

Thanks, John
It worked, I appreciate the help.............Mike

"John Vinson" wrote:

On Wed, 4 Jan 2006 11:59:01 -0800, "Mike"
wrote:

I'm trying to build an unbound MSAccess form to append records to a linked
SQL data table. when I try to set/define the variable using "Dim db As
Database" I get type not found error when I compile the code. Any clues for
me.......TKS....mw


In the VBA editor, select Tools... References. Make sure that
Microsoft DAO x.xx Object Library (highest version) is checked. With
A2000, VBA defaults to selecting the ActiveX Data Objects (ADOX)
library instead.

John W. Vinson[MVP]

  #5  
Old January 6th, 2006, 08:16 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default How do I "Dim db As Database" using a Access App linked to SQL

Thanks, Nick!
Both of the posts together seems to have cured the ills with it..........Mike

"Nick Coe (UK)" wrote:

Further to John's answer it would be a good idea to also
disambiguate your Dim statement thus:-

Dim db as DAO.Database

And any recordsets you declare also using the DAO library:-

Dim rst as DAO.Recordset

--
Nick Coe (UK)
http://www.alphacos.co.uk/ AccHelp + pAnimal
http://www.pjandcoe.co.uk/ Online Store
http://www.mrcomputersltd.com/ Repairs Upgrades

In ,
Mike typed:
I'm trying to build an unbound MSAccess form to append
records
to a linked SQL data table. when I try to set/define the
variable using "Dim db As Database" I get type not found
error when I compile the code. Any clues for
me.......TKS....mw




 




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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Very Slow Access Response Blaze General Discussion 10 October 11th, 2005 05:15 PM
Access / SQL 2000 -- ODBC Linked Table Problem Mike Morgan General Discussion 11 April 6th, 2005 07:31 PM
Unable to insert record to Access via SQL from an ASP page Norman Yuan General Discussion 1 February 2nd, 2005 08:23 PM
Access 2000 -vs- Access 2003? Mark General Discussion 5 November 30th, 2004 06:36 AM
Useless Access 2003 tired, angry, sucidial and bored General Discussion 10 July 21st, 2004 11:52 PM


All times are GMT +1. The time now is 11:38 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.