p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > Microsoft Office > Access and Access VBA > BOOK: Access 2003 VBA Programmer's Reference
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Access 2003 VBA Programmer's Reference
This is the forum to discuss the Wrox book Access 2003 VBA Programmer's Reference by Patricia Cardoza, Teresa Hennig, Graham Seach, Armen Stein; ISBN: 9780764559037

Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Access 2003 VBA Programmer's Reference section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 25th, 2009, 02:06 PM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Access getting data via VBA from SQL Server 2008

I am creatiing a data entry form in Access that wites data to an Access table. I need to be able to get one field from a master file on SQL Server call Mast_ID. In the data entry form I need to verify that the Mast_ID Just entered in data entry has a correspond Mast_ID on SQL Server. I have two linked tables to SQL Server in my Access .mbd that run queries very well using ODBC and the QBE grid. I am using the following VBA code code

'Set up select query
Dim cnnluid As ADODB.Connection
Set cnnluid = CurrentProject.Connection
Dim MaMIDRecordSet As New ADODB.Recordset
MaMIDRecordSet.ActiveConnection = cnnluid
'Add SQL to string for looking up Master_ID in
'Master Accounts Table on Server
Dim StrLUMID As String
StrLUMID = "SELECT dbo_Master_Accounts.Master_ID FROM"
StrLUMID = StrLUMID + " dbo_Master_Accounts"
StrLUMID = StrLUMID + " WHERE (((dbo_Master_Accounts.Master_ID)='Card_No'))"
'Run Select query with String containing SQL
MaMIDRecordSet.Open StrLUMID

The system tells me that "ODBC Call failed"

Hope you can be of help.

Thanks in advance

jpl458
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
HOW do you create a Login screen Using C#2008 textboxes to verify SQL SERVER DATA Silvercreek C# 2008 aka C# 3.0 0 July 28th, 2009 07:42 PM
Data Access with SQL Server Mobile column two SQL Server 2005 0 January 24th, 2009 06:29 PM
SQL Server 2K, Access 2003 and VBA SteveBH SQL Server 2000 1 January 11th, 2007 01:23 PM
Access to Sql Server data export mateenmohd SQL Server 2000 4 February 14th, 2006 02:18 PM
Using Access with SQL Server Data npepin Access 4 July 21st, 2004 04:36 PM



All times are GMT -4. The time now is 08:21 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc