LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default Syntax problem

Hi all!

I am using the following code in order to import records from access table.
cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=C:\Documents
and Settings\Eli\My Documents\ETV_Cells.mdb"
rst.Open "SELECT DISTINCT [Printing_Date] FROM " & strTableName & "
ORDER BY [Printing_Date] ;", cnn, adOpenStatic
rst.MoveFirst

With Me.cboViewPrntDate
.Clear
Do
.AddItem rst![Printing_Date]
rst.MoveNext
Loop Until rst.EOF
End With

My problem is with changing the field name ([Printing_Date]) into a string
in order to use this code for more then one field instead of duplicating the
code for each field. I tried:
strField = "Printing_Date"
strField = "[Printing_Date]"
but i got error messages that was pointed to ".AddItem rst![Printing_Date]"
line.

Thanks in advance

Eli
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
ADO syntax problem אלי Excel Programming 2 January 5th 10 05:21 AM
Problem with Syntax? MurrayBarn Excel Worksheet Functions 8 June 12th 09 01:45 PM
Help Please: Syntax Problem Oblivious Excel Programming 3 June 6th 06 03:00 PM
Syntax problem unknowndevice[_4_] Excel Programming 4 August 26th 05 10:57 PM
Another Syntax Problem Sharlene England Excel Programming 2 December 2nd 03 10:04 PM


All times are GMT +1. The time now is 06:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright 2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"