Get Value From Recordset Vba

RecordsetClone ' Move to the first record in the recordset. Recordset Set rst = New ADODB. This code provides simple functionality using VBA to allow for the creation/deletion of MySQL tables and removing/adding records to tables. Here is an illustration of the Userform that we will be. Suppose, If you want to read values of a particular column which Name is known to you but it could be 1st Column or 2nd Column or any nth column of your RecordSet Object. This program has two Function procedures and one Sub procedure. The dynamic query runs fine but I am having trouble returning the value back to Access using VBA. So using your example code, I (personally) would try something like this:. Get contacts data via DAO to document Create a UserForm to get data from an access database in to bookmarks in the activedocument with DAO connection. The sorting method of the ADODB Recordset is the only VBA sorting method known to me that can be used to sort by different fields. Press "Populate list box" button. Create a new saved query, or convert a SELECT statement to a saved query If the data you want to find is contained in more than one table, you will need to bind the form to a query that selects the data from those tables. > > HTH, > > Roy > > > > _____ > > From: [email protected] Also, be sure to check out this article - Getting the ID of the Just Inserted Database Record - it shows how to use multiple Recordsets to grab the ID of the just-inserted record!. If the count of numbers is odd the mid point is used if the count of numbers is even the average of the two values around the midpoint is used. The difference in speed is so tiny that a user won't notice it: a non-discernible difference is equal to 'no difference'. To use the ADODB connection you need add Microsoft ActiveX Data Objects reference. Hit ALT +F11 to open the VBA editor. net is a forum dedicated to Microsoft Access, if you want to ask any Access related questions or help other members out, please join our community , the registration is free and takes only one minute. [Date],Raw_Data. If a form is based on a query, for example, referring to the Recordset property is the equivalent of cloning a Recordset object by using the same query. For this example, I need to get the value in Balance field from the last record which is $300. An alternative approach could be using e. I'm writing an Access VBA procedure which will call various SQL Server stored procedures. Extract, Get Data from MySQL PHP. Populate unbound controls on report using VBA recordset opened in code. Fortunately, you can help the Jet engine find the parameters by opening the QueryDef prior to creating the recordset and telling Jet where to look for the parameters. The sub procedure reads in the numbers from the array (A1. Access VBA: Count the Records in a Recordset – Querychat One of the most basic questions we can ask about a table or other recordset is how many records there are within it. Private Sub cmb_firststage_Click() Dim rs_m. from (1)translated fromOriginal:Translated:Automatic translation powered by in turn, those RecordSet objects get. ADO returns a recordset. Return multiple values by using database recordset. MoveFirst ' Move to the first selected record. Value = rs(0) rs. MoveLast) to get an accurate count. Is this possible to get it to just magically work?. Introducing the DAO Recordset The DAO Recordset is basically a VBA object which enables us to gain access to information stored in database tables or queries via code. For that, we need to add the below code. Get recordset as array 'This value is used for rediming result array. To end the for loop at any given point we can use the exit for statement. Recordset ‘ Open the connection. Note: The Fields collection of the Recordset object is a zero based collection. I am trying to pull back a recordset in VBA to determine the highest Event ID in the table so I can increment by 1 to add the next. All i need to do now is to get these values into a ADODB. Recordset Set rst = New ADODB. sSQL = “Select Raw_Data. Using Collections in VBA. Nested recordsets. Many a times you might have observed that RecordCount Property does not return a correct number instead it always returns a number -1. (a text box, form, recordset. Then, some of the filtered values are passed to an array, and, finally, the array values are written back to the Excel sheet. Examples of where this function shines: Works well for retrieving data from Access (or other database management system) to Excel. In this How To, I will show how to get the last value of certain field from the last record. SQL, MS Access etc. Value of the recordset. VBA – Loop through arrays. For the purposes of this demonstration, I'll be using a Table called tblEmployees, a Field named [LastName], and a DAO Recordset although these Methods are equally applicable to ADO. Analysis for Excel (v1. …To do that in VBA, you can use the code that I'll show you right now, and it's. If you're only getting a single value, or you want the status text from an insert/update/alter query, you can even use this directly :. Please post a link to a workbook containing the code along with sample data and a description of what you want to see after the code is run. I'll cover the following topics in the code samples below: ADODB. com There are basically 4 Methods that you can use to access the values of Fields in Recordsets. Re: Excel recordset returns Null value Without specifying data types, when reading an Excel table, JET will use some top rows of data to guess and set data type for each column. Recordset is just a temporary table in memory that. ADO can only read the Value property once from the provider. If your recordset has a large number of rows returned, then there's no reason to iterate through all of them. Suppose we have a database named "Northwind", we can get access to the "Customers" table inside the database with the following lines: <%. So using your example code, I (personally) would try something like this:. There are basically 4 Methods that you can use to access the values of Fields in Recordsets. Get recordset as array 'This value is used for rediming result array. This blog will also post articles related to them too Happy reading. If your recordset has a large number of rows returned, then there's no reason to iterate through all of them. movenext loop endif. Set text value (string) or number (integer) to temp variable. If you have an array of queries, you can use async. Recordset field is null!'. Read or Get Data from Worksheet Cell to VBA in Excel – Solution(s): It is very simple to read the data from Excel to VBA. I creating a VBA sub routine to output a. This is made possible using the GetRows method of the Recordset Object which inturn returns a variant array. Hello, I am kinda new to VBScript, but have used C# to pull data from a SQL Server db using DataTables and Reader, etc, however I am at a loss as to how to accomplish this in VBScript. Fields(index). Why is it? You can import Access table data to Excel without even opening the Access DB. Sub FillPersons(ByRef connection As ADODB. Since some of the sprocs won't return data, I want the ability to both read a return value (which is a rowcount) AND a recordset. I can get one record's result by using the DLookup fuction, of course, but I want to get every record's value. Thus, the larger the recordset the bigger the performance hit. LocalProvider. Title Keywords ; HowTo: Use combo boxes and text boxes to let the user pick search criteria for a database query in Visual Basic 6: database, DataGridView, DataTable, DataAdapter, OleDbDataAdapter, data adapter, bind, DataSet, Visual Basic 6, VB 6. To end the for loop at any given point we can use the exit for statement. Show field name, type and value data type: 19. As far as I know, a record has many values, so your RecordSet(index) does not return the value os a record. ) but for now I’ll just show how to loop through them. EOF and rec. Here is an illustration of the Userform that we will be. Good for making audit trails. The reason for this is I have to use dynamic query to query a linked server from a database built in Progress(Uhg!). Simply assign a variant variable to this function's result. I am trying to analyse the data via vba (For each file the recordset takes the data based on criteria). A10), calls up the function procedures and returns the mean and standard deviation value. Connection and ADODB. The Value property of the Field object is its Default property viz Recordset. Manual Vba Access 2010 Recordset Findfirst The Recordset property returns the recordset object that provides the data being browsed in a form, report, list box control, or combo box control. If I SELECT * instead of MAX(EventID) I do pull back all the records which I can tell by using recordcount. An alternative approach could be using e. I am trying to pull back a recordset in VBA to determine the highest Event ID in the table so I can increment by 1 to add the next. Get recordset as array 'This value is used for rediming result array. Recordset Dim cn As ADODB. Collection types are very useful because it is easy to add items to it and iterate over the items in the collection for whatever purpose you have in mind. I read VBA Has No Class over at Excel Do, Dynamic Does with interest. It is built into the Visual Basic Editor, and has many different uses that can be very helpful when writing macros, debugging code, and displaying the results of your code. Manual Vba Access 2010 Recordset Findfirst The Recordset property returns the recordset object that provides the data being browsed in a form, report, list box control, or combo box control. If the count of numbers is odd the mid point is used if the count of numbers is even the average of the two values around the midpoint is used. Here are some VBA techniques to keep the garbage out. I am trying to analyse the data via vba (For each file the recordset takes the data based on criteria). Populate unbound controls on report using VBA recordset opened in code. The For loop is typically used to move sequentially through a list of items or numbers. Value", 0, adSearchForward, 1. …To do that in VBA, you can use the code that I'll show you right now, and it's. AddMenu Add a custom menu bar/shortcut bar. New keyword is used because in Dim statement only variable type is defined, here with "New" we are creating a New connection object and records set object and then assigning values to these two variables. How can I find the maximum value in a recordset column? Function UpperPace(lngSurveyID As Long) As Integer. Therefore, I have written some very simple macros that are activated by dragging and dropping one of two shapes onto a page, or from the macros ribbon button, in order to do the refresh, either for the active recordset in the External Data window, or for all data recordsets in the document. This allows me to create a checkbox-style input for the user, but I am having difficulty retrieving the values using SQL in VBA to create a recordset. Read record in recordset by referening the field name with '!' 17. Connection and ADODB. Why is it? You can import Access table data to Excel without even opening the Access DB. You are already setting the connection in the. The parameter query could be the immediate query or it could be an ancestor of the query. Method #1 Set Temporary Value using VBA. Repeat this process until the entire recordset is processed. Multi-User Application - Record Locking: Record locking occurs in two environments, the Microsoft Access Interface and the ADO Recordset Object. The query filters all the data based on country a criterion (Canada). It gives the row index (i) and the column index (0, 1, etc. This string opens a recordset. Update and Delete Using Excel VBA Userform, Remove Password From Excel Using Excel VBA (Coding) or you can learn much more related tips & tricks. I'm currently using ADODB (because I found something while Googling around that almost worked), but I'm open to other solutions as well. Of course, the problem I'm running into is that I can't pass a null value to a separate function so I can't separate out the logic check. An Excel Worksheet and the Output of the RunSELECT Macro Let see how to run a simple SELECT SQL Query in Excel VBA on an example Excel Worksheet. Bob says: As you can see, the disconnected recordset can do everything a collection class can do, but without having to hand-roll any of the methods, recordset has them builtin. That needs to happen inside the Do-Until-Loop, to get the current value for each customer record. MoveLast is the best and most appropriate way to populate the recordset and get its count. The VBA Immediate Window is an awesome tool that allows you to get immediate answers about your Excel files, and quickly execute code. Fortunately, you can help the Jet engine find the parameters by opening the QueryDef prior to creating the recordset and telling Jet where to look for the parameters. In order to get all of the information from the database, we need to loop through the recordset and set the. If you need to modify attribute values, you will have to bind to the object. To get this value, we need to put the variable outside of the SQL string, so that VBA can evaluate the string and then include that evaluated value into the SQL string. If use use a string like below: select * from table where name >='O' order by name asc I will get records like this: o'hara o'neil oken onet If I use the command below on a recordset with the same records recordset. We have always used Excel as a presentation layer to import data from SQL Server for analysis. Note that ELookup() requires a reference to the DAO library. Access 2007 introduced the possibility that a field in a recordset may itself be a recordset. This string opens a recordset. dbf database which is located in the same folder with the workbook, and then runs an SQL query to the recordset. Despite that, I hope you can get the most from using multiple Recordsets; for more information, look for the NextRecordset method as a keyword in ADO API Reference. Example: 1. This is because it's (fairly) easy to access each array position in a loop - you just use the loop variable between the round brackets of the array. Accessing Field Values in Recordsets - Microsoft Access / VBA Bytes. So you are saying leave it as I have it and return a recordset and then access the field value via the recordset. After you have located a particular record or records, you may want to extract data to use in your application instead of modifying the underlying source table. It could look like that: 'You'll need to declare a new variable Dim i as long If rec. I need to mention something that you did very very right. MS Access 2003: Access a value from a table using VBA code. ActiveX Data Objects (ADO) Design PhilosophyActiveX Data Objects (ADO) was originally designed as a simple and relatively lightweight COM based database API for Active Server Pages (ASP) on Internet Information Server (IIS). Getting at multiple related records using VBA. Dim cnn As New ADODB. total = total + records value from column actually is there a for each in VBA you might need to do for index = 0 to number of records in recordset "The programmer, like the poet, works only slightly removed from pure thought-stuff. Range(strExcelRange). Is that clearer. A Recordset object consists of rows and columns (like an Excel range), but the Recordset object can also hold only a single record with only one row and one column. MoveLast) to get an accurate count. There are basically 4 Methods that you can use to access the values of Fields in Recordsets. AddNew Add a new record to a recordset. VBA string to fetch a value from SQL server RecSet = CreateObject("ADODB. If you're only getting a single value, or you want the status text from an insert/update/alter query, you can even use this directly :. If you have used Microsoft ADO in your VBA project, you must have used Recordset object. The parameter query could be the immediate query or it could be an ancestor of the query. 6 from Insight Distribution. So many more things can be done with arrays (resizing, adding, deleting items, etc. This is made possible using the GetRows method of the Recordset Object which inturn returns a variant array. I read VBA Has No Class over at Excel Do, Dynamic Does with interest. As far as I know, a record has many values, so your RecordSet(index) does not return the value os a record. ActiveX Data Objects (ADO) Design PhilosophyActiveX Data Objects (ADO) was originally designed as a simple and relatively lightweight COM based database API for Active Server Pages (ASP) on Internet Information Server (IIS). sSQL = “Select Raw_Data. VBA - How to loop in recordsets and update Ajay Kumar. The Value property of the Field object is its Default property viz Recordset. open'ing a recordset the normal way, except you dont get to choose the lock & key types. Recordset is just a temporary table in memory that. …To do that in VBA, you can use the code that I'll show you right now, and it's. When we deal with data bases using ADO or DAO, we often retrieve the data using select statement to a record set, and we process to an array or we paste into a range. Get contacts data via DAO to document Create a UserForm to get data from an access database in to bookmarks in the activedocument with DAO connection. Why is it? You can import Access table data to Excel without even opening the Access DB. Once data is collected in a database, analysis and updates need to be performed. well, in order to get all the values you could browse both fields and records in your recordset. In this How To, I will show how to get the last value of certain field from the last record. I read VBA Has No Class over at Excel Do, Dynamic Does with interest. You will, however need to add the ADODB library to the project first. Let’s take a closer look at each of these loops. VBA For …. If you need a reference to the group object (perhaps to get other attribute values), use the Groups method above. Note: that the name of the Excel file is embedded in the VBA code. The dynamic query runs fine but I am having trouble returning the value back to Access using VBA. Excel VBA Programming Arrays and Loops Arrays are usually used with loops. Microsoft Access is the most popular Windows database program. varRecords(intField, intRecord) The following code example uses an SQL statement to retrieve three fields from a table called Employees into a Recordset object. This means that items with equal values keep the order in which they were added to the set. I'm very happy to see you do it the right way. Changing the Start (Seed) Value of the AutoNumber Field with SQL command: 16. When to use a form's recordset and when to use recordsetclone Recordsets are an essential tool of any Access programmer, there are many types and are used in a wide range of situations, today we're going to talk about form recordsets and provide some examples of their use. ADO Recordset Basics Posted on December 16, 2004 March 31, 2017 by Dick Kusleika I get asked how to hold an Excel query table in memory from time-to-time, so it's time for a post about it. If the count of numbers is odd the mid point is used if the count of numbers is even the average of the two values around the midpoint is used. Create a new saved query, or convert a SELECT statement to a saved query If the data you want to find is contained in more than one table, you will need to bind the form to a query that selects the data from those tables. If the value has changed, execute a SQL INSERT statement to add a new row to the new table with the Column1 value and the concatenated Column2 value(s). Recordsets are objects that represent collections (sets) of records. Otherwise it returns the first value found, or Null if there are no matches. Any code that examines the Fields of a recordset or applies criteria is affected. Examples of where this function shines: Works well for retrieving data from Access (or other database management system) to Excel. Recordset is just a temporary table in memory that. I can get one record's result by using the DLookup fuction, of course, but I want to get every record's value. The sorting method of the ADODB Recordset is the only VBA sorting method known to me that can be used to sort by different fields. You then enumerate through the recordset to output the column headings. would like to call a stored procedure in my VBA and have the stored procedure return a value. Well after spending more time than I wish to admit I thought I would post some code that I adapted/created (thanks to Carlmack for core sections of the code). Assign this macro to the shape called Get the File Path on the Export worksheet by right clicking the shape and then choosing Assign Macro and selecting the macro and then clicking OK. " I would either : Loop over the fields and create a dictionary with name/value pairs; Make sure that rst_t is of type Snapshot and just keep using rst_t. The parameterized stored procedure and VBA Function are used to prevent injection and make the database more secure. Sometime, we need a specific value of the last record. Reading RecordSet Values by Passing Column Names. The default collection of a DAO recordset object is the FIelds collection, so what you wrote is the equivalent of: Recordset. Calculating the Median of a Recordset The median of a set of numbers is the value where half the number are less than the median and half the numbers are more than the median. Asc The Ascii code of a character. For single fetches of data its fine. The difference in speed is so tiny that a user won't notice it: a non-discernible difference is equal to 'no difference'. User can choose the table and write what he/she wants to replace and with what. If you need to modify attribute values, you will have to bind to the object. Private Sub cmb_firststage_Click() Dim rs_m. SurveyID" strSQL = strSQL & " FROM tblSurvey INNER JOIN tblSurveyData ON. EOF and rec. 1 executes subroutine of code access values bound recordset, other closes modal. Let’s take a closer look at each of these loops. Then, some of the filtered values are passed to an array, and, finally, the array values are written back to the Excel sheet. Clicking on the command button calls this code. ) I'm using the PostgreSQL ODBC driver 6. However, the resulting recordset is read-only, so ADO cannot be used to modify Active Directory objects directly. Analysis for Excel (v1. VBA - How to loop in recordsets and update Ajay Kumar. 5 AS MedianSpeed, tblSurveyData. The macro below opens the Sample. We can use Cell or Range Object to refer a Worksheet Cell. I have no problem opening the recordset, reading corresponding value. Often it is required to get the records retrieved in an SQL fetch into a recordset to an array. Manual Vba Access 2007 Recordset. Create a new saved query, or convert a SELECT statement to a saved query If the data you want to find is contained in more than one table, you will need to bind the form to a query that selects the data from those tables. in turn, those RecordSet objects get populated with data when Access is sort the client-side Access Forms without any problems in Access 2007 and 2010. 1 Explore Objects and Collections Callahan Chapter 12 Introducing the Issues Application Startup form to identify the user selection is stored in a global Public. CursorType = adOpenStatic rst. Value", 0, adSearchForward, 1. An alternative approach could be using e. How can you check for null in a VBA DAO. I'll cover the following topics in the code samples below: ADODB. RecordCount I am told I need to move last since the query does not. Find strSQL 'Determine if the specified project was found If rst. RecordSetObject(0). [Access 2003 VBA] Return AutoNumberID of SQL Insert Result? Mini Spy Is there a way to get the AutoNumber ID value of the record that was just inserted via a SQL INSERT query? [Access 2003. How can I find the maximum value in a recordset column? Function UpperPace(lngSurveyID As Long) As Integer. My VBA code transfers a SAS-table to Excel-sheet via ADODB. I can loop through the recordsets and get the cursor to stop on a field whose values don't match, lets say on row #x and the programmed message will say something like: "ROW: 699 Field: [RequestStatus] rs1. Sub FindProject() Dim strSQL As String Dim rst As ADODB. In this tip we will learn about. Asc The Ascii code of a character. How can I find the maximum value in a recordset column? Function UpperPace(lngSurveyID As Long) As Integer. Recordsets have many methods and properties to make working with the records in the collection easy. Examples: To reference a field named "FirstName", which is the second field in the table, you can use any of the following:-. To use the ADODB connection you need add Microsoft ActiveX Data Objects reference. Otherwise it returns the first value found, or Null if there are no matches. Property Get: Retrieves the value of a property. Using recordset in VBA excel I have a huge data (16 files with 300,000 rows and 65 columns in each) in excel. Value and will return the first fields's value. You can add a WHERE clause ‘ if you need to filter on some criteria. …For example, you can display each product's name to ensure that you have no…duplicates in the table. 09/21/2018; 3 minutes to read +1; In this article. the IPICalculation interface of PI SDK to retrieve calculated data directly from the PI Server. LocalProvider. Connection rst. Only unique visible values from Column1 are added to the list box. If I SELECT * instead of MAX(EventID) I do pull back all the records which I can tell by using recordcount. Create Individual Reports Based On The Value Of A Given Field In A Related Table This code is designed to create individual reports as Excel Workbooks based on the value of a given field in a related table. Excel has some manual methods, such as Advanced Filter, for getting a list of distinct items from an input range. Sort or/and filter the table. In other words, a. Microsoft Access is the most popular Windows database program. However, if you are still actively investing in the stock market and use Ms-Excel, then here's an example on how to get current stock quotes, every few seconds, in your Excel file from a Web page using VBA Macro. This is because it's (fairly) easy to access each array position in a loop - you just use the loop variable between the round brackets of the array. A Collection is an type that contains a set of related objects - in memory. One important thing to keep in mind when using vlookup function is ensure that the data type matches in both source (table array) and Lookup value. Hello, I am kinda new to VBScript, but have used C# to pull data from a SQL Server db using DataTables and Reader, etc, however I am at a loss as to how to accomplish this in VBScript. Although the Recordset object has a built in RecordCount property, there are some special requirements needed in order to use it. I am able to execute the query with the values hold in ColA,ColB,SplitMonth,SplitYear for each iteration and I'm getting the ID's too in sql. This is made possible using the GetRows method of the Recordset Object which inturn returns a variant array. An Integer is another number data type, but its value must be between -32,768 and 32,767, and it must be a whole number, that is to say, it mustn't contain decimal places. [Access 2003 VBA] Return AutoNumberID of SQL Insert Result? Mini Spy Is there a way to get the AutoNumber ID value of the record that was just inserted via a SQL INSERT query? [Access 2003. Hit ALT +F11 to open the VBA editor. I then bind the form to this recordset, and the user sees the records in the form. Recordset and even a Excel. connection) Dim recordSet As ADODB. has some explanation about Null values in Access VBA apps and. BOF then Else do while not rec. Hello, I am kinda new to VBScript, but have used C# to pull data from a SQL Server db using DataTables and Reader, etc, however I am at a loss as to how to accomplish this in VBScript. Learn More. User can choose the table and write what he/she wants to replace and with what. Using Collections in VBA. Introduction. Microsoft Access Query Tips and Techniques (SQL and VBA) by Luke Chung, President of FMS, Inc. Of course, the problem I'm running into is that I can't pass a null value to a separate function so I can't separate out the logic check. Q: How can I run a report showing just orders from a specific customer - preferably from the customer record that's currently open on my screen?. Can anyone share a more efficient way to handle null values from a Recordset? The code I'm currently using is below, and some code I've attempted to use to make it better. Populate Combo box using recordset in vba Hello All, I am using the foll. This expression service is not available when you use VBA code to execute a parameterized action query or to open a recordset based on a parameterized query that returns records. SQL, MS Access etc. We will look at an example that enables us to lookup a customer's total revenue value from an Excel Formula. Access VBA DAO CopyFromRecordset Method to Copy All Fields Data from Access Table to Excel How to Transfer All Fields data from an Access DAO Recordset to Excel with VBA Macro 'Using DAO Method to Import data from an Access Database Table to an Excel worksheet. After an ADO Database Connection has been created, as demonstrated in the previous chapter, it is possible to create an ADO Recordset. Field Value New-Old: One method to make a form remember an old value after it is changed. Database Dim qd As DAO. Fortunately, you can help the Jet engine find the parameters by opening the QueryDef prior to creating the recordset and telling Jet where to look for the parameters. Depending on the cursor type chosen when opening the Recordset object this may or may not work. Excel VBA Part 56. BOF then Else do while not rec. If you have used Microsoft ADO in your VBA project, you must have used Recordset object. Recordcount property. ) Need help on something you can’t find?. code to populate my combo box. [Access 2003 VBA] Return AutoNumberID of SQL Insert Result? Mini Spy Is there a way to get the AutoNumber ID value of the record that was just inserted via a SQL INSERT query? [Access 2003. Asc The Ascii code of a character. To get the second field value in the first row, use code like the following: field2 = avarRecords(1,0) The avarRecords variable automatically becomes a two-dimensional array when GetRows returns data. The wizard should now display the Find a record on my form based on the value I selected in my combo box/list box option. The function works with a normal query, but it doesn't work with a parameter query. Method #1 Set Temporary Value using VBA. MS Access 2003: Access a value from a table using VBA code. Access/VBA - How to output data from a column as comma separated string. In this example, the array is from A1 to A10 of Sheet1 of an opened Excel Workbook. This page summarizes how to create and use DAO recordsets. Now, whenever he will click the button he will get the report of the LIVE DATA from SQL to Excel. I get the message "Object doesn't support the property or method" Thanks for your help. application that was created using Access 2007, its working perfectly with DSN, i. Checking for Existence of a Field. To end the for loop at any given point we can use the exit for statement. Of late, VBA has been disregarded by many software professionals for. Argument Description FieldList A single field name or an array of names or ordinal numbers specifying the … - Selection from Programming Excel with VBA and. Value gives you the value of the 1st Column value of the 1st Record of your RecordSet Object. Although VBA has ways of getting this information too, you might want to 'go outside' of VBA to get the milliseconds and system time directly from the windows operating system. The difference in speed is so tiny that a user won't notice it: a non-discernible difference is equal to 'no difference'.