UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Modifying Query properties with VBA    
 
   
tbrooks
post Nov 14 2005, 11:47 AM
Post #1

New Member
Posts: 2



Hi All,

Im new to this forum and hope that someone can help me. I wish to use some vba code to automate the initialization of query properties. Specifically, I want to set the value for the odbc connect string in an sql pass-through query.

The access help pages do say that this can be done, it doesnt show how though. Any help would be great.

Tz
Go to the top of the page
 
+
schroep
post Nov 14 2005, 01:05 PM
Post #2

UtterAccess VIP
Posts: 5,200
From: Denver, Colorado [USA]



CODE
  Dim qdf As DAO.QueryDef

  With CurrentDb
    Set qdf = .QueryDefs("queryname")
    qdf.Connect = "yourconnectionstringgoeshere"
    Set qdf = Nothing
  End With

Welcome to UA! (IMG:http://www.utteraccess.com/forum/style_emoticons/default/cool.gif)
Go to the top of the page
 
+
tbrooks
post Nov 17 2005, 04:14 AM
Post #3

New Member
Posts: 2



Hey, this is great. However, I dont seem to have the add-ins in my ms access for data access objects. Would appreciate some pointers of how to get these.

Tz
Go to the top of the page
 
+
truittb
post Nov 17 2005, 08:19 AM
Post #4

Retired Moderator
Posts: 13,544
From: Texas (Is there anywhere else?)



You need to set a Reference to Microsoft Data Access Object 3.x in the VBE Menu Tools, References.
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 22nd May 2013 - 10:07 PM