PC Review


Reply
Thread Tools Rate Thread

ADO code with combox box gives errors

 
 
Rod
Guest
Posts: n/a
 
      12th Nov 2008
I am trying to populate a combo box with records from an Access data table.
I think this is possible using ADO, so I wrote the routine to populate the
combo when the form is opened. Every time I open the form, I get an error
saying "Expected end of statement line3". Line 3 is: "Dim Conn1 As New
adodb.Connection". It is really the first line of code in the Open_Item
function. If I can get by this error, I think I can figure the rest out.

Rod


 
Reply With Quote
 
 
 
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      13th Nov 2008
Is this code running in an Outlook custom form? If so it uses VBScript code
and all objects are Variant and don't take As clauses. Use only Dim Conn1.

If this code is running in an Access form then please post your question in
an Access group as it would have nothing to do with Outlook.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Rod" <(E-Mail Removed)> wrote in message
news:1D5012EC-3DA9-4FB6-8F29-(E-Mail Removed)...
>I am trying to populate a combo box with records from an Access data table.
> I think this is possible using ADO, so I wrote the routine to populate the
> combo when the form is opened. Every time I open the form, I get an error
> saying "Expected end of statement line3". Line 3 is: "Dim Conn1 As New
> adodb.Connection". It is really the first line of code in the Open_Item
> function. If I can get by this error, I think I can figure the rest out.
>
> Rod
>
>


 
Reply With Quote
 
Rod
Guest
Posts: n/a
 
      13th Nov 2008
Ken,

Yes, this form is in Outlook. Your answer was most helpful. It reminded me
of the language (VBScript), Outlook is using. That makes it easier to ask
the right question and get the correct answer.

rod

"Ken Slovak - [MVP - Outlook]" wrote:

> Is this code running in an Outlook custom form? If so it uses VBScript code
> and all objects are Variant and don't take As clauses. Use only Dim Conn1.
>
> If this code is running in an Access form then please post your question in
> an Access group as it would have nothing to do with Outlook.
>
> --
> Ken Slovak
> [MVP - Outlook]
> http://www.slovaktech.com
> Author: Professional Programming Outlook 2007.
> Reminder Manager, Extended Reminders, Attachment Options.
> http://www.slovaktech.com/products.htm
>
>
> "Rod" <(E-Mail Removed)> wrote in message
> news:1D5012EC-3DA9-4FB6-8F29-(E-Mail Removed)...
> >I am trying to populate a combo box with records from an Access data table.
> > I think this is possible using ADO, so I wrote the routine to populate the
> > combo when the form is opened. Every time I open the form, I get an error
> > saying "Expected end of statement line3". Line 3 is: "Dim Conn1 As New
> > adodb.Connection". It is really the first line of code in the Open_Item
> > function. If I can get by this error, I think I can figure the rest out.
> >
> > Rod
> >
> >

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Filter a combox based on selection from another combox David Microsoft Access Form Coding 2 22nd Jan 2010 12:05 AM
add combox with code Dawna Microsoft Excel Programming 6 24th Nov 2009 04:21 AM
Combox box in SQL code red6000 Microsoft Access 1 15th Jul 2006 08:43 PM
VBA Code Errors =?Utf-8?B?UGF1bFc=?= Microsoft Excel Misc 3 4th Apr 2006 01:21 PM
bcp code errors tanala Windows XP Performance 0 9th Aug 2004 03:30 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:39 AM.