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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Access DAO Query
In Access 2000 DAO, what is the syntax to refer to a field in an open query?
|
#2
|
|||
|
|||
Trick question.
An opened query on screen is not a reference-able object, like say a form is. Thus once it's opened, it's just there. Explain what you're really trying to do, and we'll tell you how to do it. -- Steve Clark, Access MVP FMS, Inc. Call us for all of your Access Development Needs! 1-888-220-6234 www.fmsinc.com/consulting "Bill Andersen" Bill wrote in message ... In Access 2000 DAO, what is the syntax to refer to a field in an open query? |
#3
|
|||
|
|||
|
#4
|
|||
|
|||
Any of the following will do:
dim rst as DAO.Recordset set rst = CurrentDB.OpenRecordset ("name of a table or query") debug.print "Value of a field in rst: " & rst.name of the field OR debug.print "Value of a field in rst: " & rst.Fields ("name of the field") OR debug.print "Value of a field in rst: " & rst.Fields(Ordinal referring to the field, starting at 0) Good Luck! -- Chaim "Bill Andersen" wrote: In Access 2000 DAO, what is the syntax to refer to a field in an open query? |
#5
|
|||
|
|||
Chaim showed me the way. I need to open the query as a recordset, then I can
refer to the field as "rst.fields("field name"). thanks for your attention. Bill Andersen "[MVP] S.Clark" wrote: Trick question. An opened query on screen is not a reference-able object, like say a form is. Thus once it's opened, it's just there. Explain what you're really trying to do, and we'll tell you how to do it. -- Steve Clark, Access MVP FMS, Inc. Call us for all of your Access Development Needs! 1-888-220-6234 www.fmsinc.com/consulting "Bill Andersen" Bill wrote in message ... In Access 2000 DAO, what is the syntax to refer to a field in an open query? |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Why can't I see my Access query through Word?? | LisaLev | General Discussion | 1 | September 26th, 2005 07:34 PM |
What is the difference between 2002 and 2003? | Red Sonya | General Discussion | 2 | March 1st, 2005 05:10 AM |
How to use a Access Query that as a parameter into Excel database query | Karen Middleton | Setting Up & Running Reports | 1 | December 13th, 2004 07:54 PM |
Linking problem - Access query to MS query to extract data to Exce | FatMan | Running & Setting Up Queries | 0 | November 23rd, 2004 06:43 PM |
Merging MS Word document with MS Access 2002 criteria query | Doug Robbins | Mailmerge | 2 | November 4th, 2004 05:57 PM |