Reference a table field in VBA

I've got a current Access project that I'm building.  The source files are 
downloaded reports and imported through VBA functions.  I'm timestamping the 
source files during the import process.  I now need to reference that 
particular timestamp (it will only be one timestamp) and use it as a variable 
in an export function later on in my VBA.

Here is an example of my datapoint

Sourcetable: sourcetable_1
Field: Run_Dte

Variable of Run_Dte needed

Export:
DoCmd.RunSQL ("SELECT A, B, C INTO [Excel 8.0;Database=C:\QC_PREVIEW_" & 
Format(Run_Dte, "yyyy-mm-dd hhmmss") & ".xls].QC " & _
"FROM qry_QC_Preview")

Hope that makes sense and thanks in advance for replies given....


-- 
Chris Unger
Analyst - Tyler, TX
0
Utf
7/2/2007 9:46:01 PM
access 16762 articles. 2 followers. Follow

0 Replies
1755 Views

Similar Articles

[PageSpeed] 19

Reply:

Similar Artilces:

Importing HTML Table
Hello, I'm currently writing a small web page that generates a simple table to export some data into excel readable form. I use the standard html table tags, but it seems some attributes are not taken into account. For example "border" works, but not "cellpadding". I wanted to know if there's some place describing precisely what excel ignores when it imports some html table. thanks in advance J. ...

Cell Value as Named Range Reference
Little bit of a quirky question... Trying to use a cell value as a reference in a formula, where that cell value is the name of a named range. So, assume A1:A3 is a named range: Rng1. And, B1:B3 is Rng2. I want to get the correlation vale for A1:A3 and B1:B3 So, cell D1 contains "Rng1" and D2 has "Rng2"; and cell D3 has the formula: =correl(D1,D2). But I get an error. Have also tried using Indirect to no avail. Any help would be hugely appreciated. Thank you. =CORREL(INDIRECT(D1),INDIRECT(D2)) -- Wigi http://www.wimgielis.be = Excel/VBA, soccer and music "ste...

symbols won't work in form fields
I have Access 2002. We write a lot of letters in French and as I have a QWERTY keyboard, we have shortcuts for the french letters which are missing from the keyboard. For example Ctrl + e is e with an accute accent, Alt + e is e with a grave accent, and so on. It all works just fine in WORD. But in my forms in my ACCESS database, in my fill-in fields, the shortcuts simply don't work. And there is no "symbol" option available in the tool bar to insert a symbol or French character. Is there any way I can add this function in to the database ? thanks .. Roger ...

Non-verbose TABLE syntax
I just stumbled upon this (should appeal to the SELECT * fanatics<g>):TABLE Table1, Table2;Apparently valid Jet 4.0 SQL syntax that returns all columns for thecross join of the tables. What do you reckon: OK for production code<g>?Jamie.--...

Need to reference a block of cells from another sheet.
Dear All, apologies if this is probably a mundane question, but I didn't know what 'search terms' to put in google to return any results.. I've got a Spreadsheet with 12 tabs (sheets), I need part of tab 12 (sheet) to appear on tabs 1-11 (sheets), so that if I change data in tab 12 (sheet), tabs 1-11 (sheets) are changed too.. the cells themselves will never move location, just the data within them.. Is it possible? Regards Paul. On your sheet1 select the cell that should receive the data from Sheet12; Hold down the Shift key and Click on Sheet11 << this shoul...

number of fields exceeds 256 when importing from a dbf file
Hey evryone, I'm having a small problem with importing some old data from a FileMaker Pro database. According to what I found out in the groups archive the best bet is to convert it to a dbf file and then import it. However, I the number of fields in the dbf file exceeds 256, so the import wizard truncates the import at field number 256. I would now want to spread the data over two sheets. However, in the process of converting it to a dbf, quite a few of the field names get truncated and therefore have the same name, so I can't use SQL to retrieve them. My question is: what i...

Locking Fields in an Editable Form
Hello, I created a form that has the Allow Edits selected as Yes. But I only want 2 fields in the form to be editable, the remaining other fields I'd like them to be locked. Is there a way I can lock the other fields so that it's not changed? When I try to change the field property for Locked as Yes, it locks the field so that when I enter any new records it will not allow me to input data in that field. Can anyone suggest how I can modifiy my existing form so that it locks most of the fields after it's saved but allows edits to specific fields when going back on a record? Th...

refering to a name range area as a reference value multiple times on a worksheet at different locations
i was wondering if i had posted this in the right section as it could apply to both please could you take a look at the following post http://groups.google.com/group/microsoft.public.excel.misc/browse_thread/thread/f088a5737dd26570 thank you Is there some reason you can't post your question here instead of asking us to look elsewhere? -- Don Guillett Microsoft MVP Excel SalesAid Software dguillett@gmail.com "Blinds Nottingham" <bradrail.blinds.awnings@googlemail.com> wrote in message news:d8768e43-e035-45eb-856a-0ccdc843441d@g1g2000yqi.googlegroup...

Pivot Table question #3
Hi Folks: I'm helping a pal with a table that has little data, and when the PT is setup, the result is 90% of the cells have the word "blank" Any way to have the cells show nothing (be empty) ?? Thanks Steve Try just typing a space character over it the (blank). Debra Dalgleish has a pivottable addin that you may want to use to make somethings easier: http://www.contextures.com/xlPivotAddIn.html and for instructions: http://www.contextures.com/xlPivotAddIn02.html s boak wrote: > > Hi Folks: > > I'm helping a pal with a table that has little data, and wh...

What is IVA# in Distribution Reference and Reference?
We did an inventory adjustment and now we get a unknown amount in Debit under the Inventory account and Credit for COGS account in the Transaction Entry Zoom. We're trying to figure out where that amount came from but we couldn't zoom more than what it's currently shown. In both fields, Reference and Distribution Reference, it's shown IVA#######... that is unknown to or setup by us in anywhere, i.e. Audit Trail, Source Document. Does this amount affect the dollar in the accounts mentioned? And can anyone please help to where we could drill down the IVA details?...

Sort by empty fields
Hi: I have a mailing list, and about 1/3 of the records do not have email addresses. QUESTION: how do I sort the list so that only the records with empty email address fields appear? Thanks, Mark Flynn Hi Mark, use the AutoFilter at Data=>Filter and then use Custom... Best Markus >-----Original Message----- >Hi: >I have a mailing list, and about 1/3 of the records do not have email >addresses. >QUESTION: how do I sort the list so that only the records with empty email >address fields appear? >Thanks, Mark Flynn > > >. > You can use an AutoFilter ...

Pivot Table
This is my first post here...I hope that i've chosen the right category.... My problem is similiar to other people's when it comes to consolidating ranges with Pivot Table (sorry for my english...). I've searched the forum but I haven't found either solution or workaround for my problem. My data is divided into 2 sheets, because i need to use more than 255 columns (about 433). It looks like this: col1(ID) col2(Chain store category) col3(address) col4(date) col5-col255 (product's data). One product uses 9 columns like: space on a shelf, price, comments.... Bacause...

Pivot Table sort
Hi, I am trying to create a pivot table of of some small data and when it is created it unsorts the dates. In my data sheet i have it as January 2008, February 2008,March 2008 etc yet my columns in the pivot are not in that order....how can i place them in the correct order? Use a helper col to convert the text dates to real dates, eg: In B2, copied down: = -- A2 where A2 down contains the text dates Then pivot using col B instead of col A, and it'll sort correctly in chrono order (you can format it as date to taste) -- Max Singapore http://savefile.com/projects/236895 Downloads:25...

Pivot Table
Hi all, a double click on a "data" pivot item creates a new sheet containing all the related rows. Instead of this I need to have the VBA code able to obtain the same result in an array (without the creation of the new sheet). The pivot table is connected to an external source (Oracle db). Many thanks in advance. Kind regards, Rodolfo ...

macro button refers to prev. workbook?
Hi, When I create a macro in Excel, and assign a button to it, it works fine the first time, but when I re-open the workbook for a second time, and try to run the macro again, the macro seems to refer to the previous workbook...For some reason, the macro saves the name of the previous workbook... Sub test() ' Dim name As String Dim adress As String Sheets("sheet1").Select Range("A1").Select name = ActiveSheet.Range("B6").Value adress = ActiveSheet.Range("B4").Value ActiveWorkbook.SaveAs Filename:="C:\WINDOWS\Desktop\Temp...

FA
I would like to create a report which mimics the Fixed Assets Purchasing Inquiry. I'm not sure which table holds this data. Can anyone show me a way to find out? Thanks jimr, FA01400 - Asset Purchase Master FA01401 - Asset Purchase Master Work Frank Hamelly MCP-GP, MCT East Coast Dynamics www.eastcoast-dynamics.com Jim, In order to determine the tables involved with a particular window -- in this case the Fixed Assets Purchasing Transactions window, you can go to the Tools menu of the window itself, choose Resource Descriptions and select Windows. This will open the Windows Descr...

Column and Row reference
How do i hide the column and row reference number in a sheet, when viewing the worksheet i do not to show the top and right hand side references Dave Tools>Options>View. Uncheck "row and column headers". Good idea to spend a few minutes browsing through the various Tools>Options tabs to see what else is available to toggle on/off. Gord Dibben Excel MVP On Mon, 19 Jul 2004 15:53:02 -0700, "Dave" <Dave@discussions.microsoft.com> wrote: >How do i hide the column and row reference number in a sheet, when viewing the worksheet i do not to show the top an...

Disallow viewing table definitions
SQL 2005 or 2008, how do you configure security to allow a user to SELECT data from a table but not view the table definition? I tried GRANT SELECT on both the table and schema, but that also allows viewing table definition. Executing REVOKE VIEW DEFINITION on either the table or the schema doesn't do it. The user is in on roles (other than Public of course). Thanks Vern Rabe Hi Vern, If you are worried about them seeing other columns in the table then abstract what they should see by using a VIEW instead - just permission them to the view rather than the base table...

Cube returns dimension from whole table, not from query?
Hello, in excel, I get data from sql server 2k. I create a query like this: select ... from tblCustomers, tblSelection where tblCustomers.customerid = tblSelection.id The table tblCustomers has thousands of customer id's; but the table "tblSelection" has only a few - those that need to be included in this particular Excel report. When I run the query in MS Query, it works correctly, i.e. it returns only the selected customers. However, then I create OLAP cube in MS Query, save it as file, and return the cube to Excel. In the resulting pivot table, Customers include not ...

How to catch event onclick when user click on a PowerPoint VBA but
Hi all. You can visit this link : http://www.vbforums.com/showthread.php?t=510375 Like that application, I try to show a PPT file within a form by using FindWindow() and SetParent() Function of "user32.dll" by C#. I can catch events such as: begin show, end show, next slide, next, previous, next build... by build functions to handle that events (for a object of Micorosoft.Office.Interop.PowerPoint.SlideShowWindow) . It works ok. But if slide has a VBA button (to run a marco or show animation ...) or has a video clip and you need to click on it to play, I can not ca...

Missing References
I had a problem today with a missing reference - Microsoft Forms 2 on a colleague's machine at work (Office 2003; VBA 6.5; XP). I've read Chip Pearson's "Missing References in VBA" which is a geat explanation about how to fix problems like this. Oddly the library didn't seem to be flagged as "missing" and was in fact present in the system32 directory but didn't show up in the list of available references. Now to the questions: I'm not clear on whether if I write code in a project that references a library which is not part of the &qu...

How do you create a complicated pivot table graph?
I am trying to create a little bit complicated pivot table graph with many trend lines and bars. So far I was able to create a basic graph but can not create anything complicated. Please assist. Regards, Natalia Hi Natalia - Pivot tables are very useful, but my experience is that in all but the most simple cases, pivot charts are limited and limiting. I make regular charts from pivot table data all the time. Excel has a tendency to assume that you're using a pivot table for the data, so you must want a pivot chart; as long as you avoid this tendency, you'll be fine. Start by...

Reference
Is it possible to create a reference to another object such as: int & x = i; but using an image list, and referencing different objects depending on a condition? such as : CImageList & imageList; if (thumbnail == 1) imageList = m_ImageListThumb; else imageList = m_ImageListFullSize; Hope this makes sense! Ben You're better off using pointers for this. I believe, depending on the class, that what you're trying to will make a copy of the object instead of referencing it. "Ben Williamson" <oakdaleclose@googlemail.com> wrote in message news:43ee4603...

CRM 4 workflow and updating read only fields
Having got used to the old CRM 3 workflow process I'm having to optimise some of my workflows now we've upgraded to CRM 4. However I don;t seem to be able to update a field that is marked as read only on the main form. The field shows up as gray'd out in the workflow GUI? Clearly the workflow can update the field in code reguardless of the read status on the form. So as a workaround I ahve to make the field non read only till I've created the workflow and then set it back to read only after. Or am I missing some trick to update a read only field? Thanks ...

Intersection of tables
Hi How can I find intersection of two tables i.e. records in one table which are not in the second table while matching values in two fields simultaneously in each table i.e. matching table1.id1 and table1.id2 with table2.id1 and table2.id2 respectively? Thanks Regards Open to the database window and go to queries. Click on New and select UnMatched Query. See if that will work for you. PC Datasheet Providing Customers A Resource For Help With Access, Excel And Word Applications resource@pcdatasheet.com "John" <John@nospam.infovis.co.uk> wrote in message news:u...