﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>A1VBCode Forums / Classic Visual Basic (VB 6 or earlier) / VBA(Excel, Word, etc...) </title><generator>InstantForum.NET v4.1.1</generator><description>A1VBCode Forums</description><link>http://www.a1vbcode.com/vbforums/</link><webMaster>forums@a1vbcode.com</webMaster><lastBuildDate>Sun, 21 Mar 2010 00:26:38 GMT</lastBuildDate><ttl>20</ttl><item><title>how to embed ms office into vb 6</title><link>http://www.a1vbcode.com/vbforums/Topic28895-14-1.aspx</link><description>hi sir...i just want to ask if how i could &lt;/P&gt;&lt;P&gt;embed microsoft office application in vb 6&lt;/P&gt;&lt;P&gt;that the content will be saved in the database and can be viewed &lt;/P&gt;&lt;P&gt;from the database....&lt;/P&gt;&lt;P&gt;mysql database..&lt;/P&gt;&lt;P&gt;thanks..</description><pubDate>Tue, 16 Feb 2010 06:35:30 GMT</pubDate><dc:creator>belat</dc:creator></item><item><title>Problems running VBA code within Excel</title><link>http://www.a1vbcode.com/vbforums/Topic28892-14-1.aspx</link><description>Have created the following code to export Excel worksheet data to Access database. Had early issues with registering type to allow system to recognize the Dim statement. Setup object library to include Microsoft DAO 3.6 Object Library, but now when trying to compile macro I get a runtime error '429' that an ActiveX component can't create object on the Set db statement of the code. What am I missing?&lt;/P&gt;&lt;P&gt;Sub DAOFromExcelToAccess()&lt;BR&gt;'exports data from the active worksheet to a table in an Access database&lt;BR&gt;'this procedure must be edited before use&lt;BR&gt;Dim db As Database, rs As Recordset, r As Long&lt;BR&gt;&lt;FONT style="BACKGROUND-COLOR: #dddd33"&gt;Set db = OpenDatabase("C:\Documents and Settings\sward\My Documents\Austell Equipment\GM-130\Productivity Reports\Machine_Logging.mdb")&lt;BR&gt;&lt;/FONT&gt;'open the database&lt;BR&gt;Set rs = db.OpenRecordset("GM130", dbOpenTable)&lt;BR&gt;'get all records in a table&lt;BR&gt;r = 1 'the start row in the worksheet&lt;BR&gt;Do While Len(Range("A" &amp;amp; r).Formula) &amp;gt; 0&lt;BR&gt;'repeat until first empty cell in column A&lt;BR&gt;With rs&lt;BR&gt;.AddNew 'create a new record&lt;BR&gt;'add values to each field in the record&lt;BR&gt;.Fields("Customer") = Range("A" &amp;amp; r).Value&lt;BR&gt;.Fields("Metallizer") = Range("B" &amp;amp; r).Value&lt;BR&gt;.Fields("Met_Date") = Range("C" &amp;amp; r).Value&lt;BR&gt;.Fields("Vac_Roll_Number") = Range("D" &amp;amp; r).Value&lt;BR&gt;.Fields("Met_Quality") = Range("E" &amp;amp; r).Value&lt;BR&gt;.Fields("Met_Performance") = Range("F" &amp;amp; r).Value&lt;BR&gt;.Fields("Met_Downtime") = Range("G" &amp;amp; r).Value&lt;BR&gt;.Fields("Slitter") = Range("H" &amp;amp; r).Value&lt;BR&gt;.Fields("Slit_Date") = Range("I" &amp;amp; r).Value&lt;BR&gt;.Fields("Slit_Quality") = Range("J" &amp;amp; r).Value&lt;BR&gt;.Fields("Slit_Performance") = Range("K" &amp;amp; r).Value&lt;BR&gt;.Fields("Slit_Downtime") = Range("L" &amp;amp; r).Value&lt;BR&gt;'add more fields if necessary...&lt;BR&gt;.Update 'store the new record&lt;BR&gt;End With&lt;BR&gt;r = r + 1 'next row&lt;BR&gt;Loop&lt;BR&gt;rs.Close&lt;BR&gt;Set rs = Nothing&lt;BR&gt;db.Close&lt;BR&gt;Set db = Nothing&lt;/P&gt;&lt;P&gt;End Sub&lt;BR&gt;</description><pubDate>Mon, 15 Feb 2010 11:17:24 GMT</pubDate><dc:creator>sclward</dc:creator></item><item><title>Export Excel worksheet to Access using VBA</title><link>http://www.a1vbcode.com/vbforums/Topic28797-14-1.aspx</link><description>I'm wanting to export an Excel worksheet to an existing Access table. I want to do this from within Excel using VBA and a user macro. I want to be able to append the existing records within the Access table. What's the best way to do this? Thanks.</description><pubDate>Sun, 31 Jan 2010 12:08:31 GMT</pubDate><dc:creator>sclward</dc:creator></item><item><title>Use sub</title><link>http://www.a1vbcode.com/vbforums/Topic28775-14-1.aspx</link><description>I'm using Visual Basic in Excel 2003.&lt;/P&gt;&lt;P&gt;I have a Sub definied as follow:&lt;/P&gt;&lt;P&gt;Public Sub Conect(ByVal hServer As Long, ByVal hpool As Long, ByVal vServerName As Long, ByVal vUserName As Long, ByVal vPassword As Long, hUser As Long) &lt;/P&gt;&lt;P&gt;  BODY&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;The thing is when I try to call the Sub I'm doing as follow:&lt;/P&gt;&lt;P&gt;Sub Conect(hServer, hpool, vServerName, vUserName , vPassword , hUser&amp;nbsp&lt;img align="absmiddle" src="http://www.a1vbcode.com/vbforums/Skins/Classic/Images/EmotIcons/Wink.gif" border="0" title="Wink"&gt; &lt;/P&gt;&lt;P&gt;When I call the Sub I get the next error message:&lt;/P&gt;&lt;P&gt;Compile error: &lt;/P&gt;&lt;P&gt;Expected:=&lt;/P&gt;&lt;P&gt;Could anyone help me to understand why is this happening and how can I fix it?&lt;/P&gt;&lt;P&gt;The thing is that when I use only one variable I don't have any problem</description><pubDate>Thu, 28 Jan 2010 15:13:10 GMT</pubDate><dc:creator>samuvk</dc:creator></item><item><title>Need code for expanding Word table rows with copied default formfields</title><link>http://www.a1vbcode.com/vbforums/Topic28712-14-1.aspx</link><description>I'm working on a Word template (form) that contains tables having a mix of formfields such as textinput, dropdowns, and checkboxes.  I would like to provide a single default data row for each table, but if the user enters valid data in the first cell of the last row, the table expands with a new default row below the active cell the user just filled in. The following code is latest draft for a table where default textinput for cell(1) is "nn", but requires at least two data rows and is not smart enough to know if another default row is available below the active (selected) cell:&lt;/P&gt;&lt;P&gt;Sub AddRow()&lt;BR&gt;    Dim thisDoc As Document&lt;BR&gt;    Set thisDoc = ActiveDocument&lt;BR&gt;    Dim oTable As Table&lt;BR&gt;    Dim oCell As Cell&lt;BR&gt;    Dim oPrevRow As Row, oNewRow As Row&lt;BR&gt;    Dim tmp&lt;BR&gt;    'Unprotect Document&lt;BR&gt;    If thisDoc.ProtectionType &amp;lt;&amp;gt; wdNoProtection Then&lt;BR&gt;        thisDoc.Unprotect&lt;BR&gt;    End If&lt;BR&gt;   &lt;BR&gt;    tmp = Selection.Text&lt;BR&gt;    If tmp &amp;lt;&amp;gt; "nn" Then&lt;BR&gt;        If tmp &amp;lt;&amp;gt; "n" Then&lt;BR&gt;        'Selection.FormFields(1).TextInput.Clear&lt;BR&gt;            ' Copy last row&lt;BR&gt;            Set oTable = thisDoc.Tables(10)&lt;BR&gt;            Set oPrevRow = oTable.Rows(oTable.Rows.Count)&lt;BR&gt;            oPrevRow.Range.Copy&lt;BR&gt;            Set oNewRow = oTable.Rows(oTable.Rows.Count)&lt;BR&gt;            ' Copy last row to new row&lt;BR&gt;            oNewRow.Range.Paste&lt;BR&gt;            &lt;BR&gt;        End If&lt;BR&gt;    End If&lt;BR&gt;    'Protect Document&lt;BR&gt;    If thisDoc.ProtectionType = wdNoProtection Then&lt;BR&gt;        thisDoc.Protect wdAllowOnlyFormFields, NoReset:=True&lt;BR&gt;    End If&lt;BR&gt;End Sub&lt;/P&gt;&lt;P&gt;I also would like to ensure that the formfields in the new row are reset to their default values without resetting the entire form.</description><pubDate>Tue, 19 Jan 2010 15:34:52 GMT</pubDate><dc:creator>SeefDawg</dc:creator></item><item><title>Loss VBA Password</title><link>http://www.a1vbcode.com/vbforums/Topic28545-14-1.aspx</link><description>Anybody can help me how to crack my excel VBA password?</description><pubDate>Sat, 12 Dec 2009 03:01:26 GMT</pubDate><dc:creator>yuro84</dc:creator></item><item><title>A template for making bound documents</title><link>http://www.a1vbcode.com/vbforums/Topic28585-14-1.aspx</link><description>&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;SPAN lang=EN-US style="mso-ansi-language: EN-US"&gt;&lt;FONT size=3&gt;&lt;FONT color=#000000&gt;&lt;FONT face=Calibri&gt;I would like to have a template for preparation of bound documents.&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;SPAN lang=EN-US style="mso-ansi-language: EN-US"&gt;&lt;FONT size=3&gt;&lt;FONT color=#000000&gt;&lt;FONT face=Calibri&gt;For example, I have prepared a document of 4 pages. On an extra (5&lt;SUP&gt;th&lt;/SUP&gt;, auxiliary) page there is an inscription “Bound, numbered and sealed are 4 (Four) sheet(s)”.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"&gt;&lt;SPAN lang=EN-US style="mso-ansi-language: EN-US"&gt;&lt;FONT size=3&gt;&lt;FONT color=#000000&gt;&lt;FONT face=Calibri&gt;Then I cut this inscription with scissors, staple the document, sew it with a thread, and then glue the sticker.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;</description><pubDate>Sun, 27 Dec 2009 04:23:28 GMT</pubDate><dc:creator>Pepper</dc:creator></item><item><title>Testing for blank and/or empty rows or columns</title><link>http://www.a1vbcode.com/vbforums/Topic28584-14-1.aspx</link><description>I wish to loop through each row of a set area of a worksheet and delete only those rows which have nothing stored, regardless of whether they have never been used, or, if they once had contents in a cell/s that have since been cleared.  If any cell in the row has had its formatting altered or anything, I still wish it to be considered empty; as long as there is no formula or entry in a cell, I want it detected to be deleted.&lt;/P&gt;&lt;P&gt;1.  My text has the line&lt;/P&gt;&lt;P&gt;If IsEmpty(Range("A1")) then ....&lt;/P&gt;&lt;P&gt;which will test only if a particular cell is empty.&lt;/P&gt;&lt;P&gt;If I try&lt;/P&gt;&lt;P&gt;If IsEmpty(rows(1)) then&lt;/P&gt;&lt;P&gt;there is no compile error, but, if row 1 (1) has nothing in any cell, it still won't match if I have nothing in row 1 of the worksheet.&lt;/P&gt;&lt;P&gt;2.  What is the difference between somthing being &lt;EM&gt;empty&lt;/EM&gt; or something being &lt;EM&gt;null&lt;/EM&gt;?  I have tried other codes with &lt;EM&gt;null&lt;/EM&gt; to try to detect empty lines, but they've caused run errors or again logical ones.&lt;/P&gt;&lt;P&gt;Many thanks to anyone who can assist :-)</description><pubDate>Sat, 26 Dec 2009 19:08:40 GMT</pubDate><dc:creator>devophil</dc:creator></item><item><title>VBA MSG BOX</title><link>http://www.a1vbcode.com/vbforums/Topic28546-14-1.aspx</link><description>Hi,&lt;br&gt;Can someone help me? I want to develop my spreadsheet as below;&lt;br&gt;Let say if:&lt;br&gt;&lt;br&gt;A1&gt;12.5 the off spec msg box will appear&lt;br&gt;B1&gt;12,  the off spec msg box appear&lt;br&gt;&lt;br&gt;In the msg box:&lt;br&gt;A= offspec. Reason = To be filled by user. Action taken: To be filled by user&lt;br&gt;B=offspec. Reason=To be filled in by user. Action taken: To be filled by user&lt;br&gt;Ok button.&lt;br&gt;&lt;br&gt;After click ok button, another form appear in excel format and the input at the “to be filled by user” will be appear in the form&lt;br&gt;</description><pubDate>Sat, 12 Dec 2009 04:17:46 GMT</pubDate><dc:creator>yuro84</dc:creator></item><item><title>Controls- Populating a textbox with Access values</title><link>http://www.a1vbcode.com/vbforums/Topic28477-14-1.aspx</link><description>Hi &lt;/P&gt;&lt;P&gt;I'm working on Access 2003 and i was creating a report. Now that i'm done creating my report how do i go about binding textboxes [Unbound Fields] to dbase or what's the code that populates the the textbox in the report which should pick up a certain column in a certain table in a database</description><pubDate>Thu, 03 Dec 2009 07:57:27 GMT</pubDate><dc:creator>Sunzah</dc:creator></item><item><title>Excel Update</title><link>http://www.a1vbcode.com/vbforums/Topic28376-14-1.aspx</link><description>Hey Guys,&lt;br&gt;&lt;br&gt;I have been left an excel spreadsheet from the last IT person here. He left some documents on how to setup the machine for this but left a whole load of information out, for example that I need to register WINSOCK.&lt;br&gt;&lt;br&gt;I have got one PC working with the spreadsheet but the other machine errors when when I try to do an update with "#ErrorDB Error: Update AskDiscountMargin not updated." If I run excel with as Admin it works fine.&lt;br&gt;&lt;br&gt;What would the best way of debuging this be?&lt;br&gt;&lt;br&gt;The sheet is updating a MySQL database, I have all the permissions on WINSOCK etc.&lt;br&gt;&lt;br&gt;Thanks for your help.&lt;br&gt;&lt;br&gt;Chris</description><pubDate>Fri, 13 Nov 2009 11:03:28 GMT</pubDate><dc:creator>kippi</dc:creator></item><item><title>DATE COLUMN</title><link>http://www.a1vbcode.com/vbforums/Topic28235-14-1.aspx</link><description>I am connecting to Oracle through MS QUERY.  The result is put into excel.&lt;P&gt;Set Query = QuerySheet.QueryTables("MONEY")&lt;BR&gt;Query.Sql = "SELECT NUMB_TBLE.NUMB_NAME, TO_CHAR(NUMB_DATES_TBLE.DAY_MTH_YR, 'MONTH'), SUM(NUMB_TBLE.NUMB_PAY) " _&lt;BR&gt;&amp;amp; "FROM JES.NUMB TBLE NUMB TBLE,&lt;BR&gt;JES.NUMB_DATES_TBLE NUMB_DATES_TBLE" _&lt;BR&gt;&amp;amp; "WHERE NUMB_TBLE.NUMB_ID = NUMB_DATES_TBLE.NUMB_ID AND NUMB_TBLE.NUMB_CODE IN (" &amp;amp; NumList &amp;amp; ") " _&lt;BR&gt;&amp;amp; "Group by numb_tble.numb_name, TO_CHAR(NUMB_DATES_TBLE.DAY_MTH_YR, 'MONTH')&lt;BR&gt;ORDER BY TO_CHAR(NUMB_DATES_TBLE.DAY_MTH_YR, 'MONTH')&lt;/P&gt;&lt;P&gt;This doesn't accomplish what I want&lt;/P&gt;&lt;P&gt;In my query, I want to display the month in words&lt;BR&gt;I want to order the month by number&lt;/P&gt;&lt;P&gt;For example the result would be&lt;/P&gt;&lt;P&gt;Jones January 10.00&lt;BR&gt;Doe April 20.00&lt;/P&gt;&lt;P&gt;How do I do this?</description><pubDate>Thu, 24 Sep 2009 15:34:35 GMT</pubDate><dc:creator>gencom99</dc:creator></item><item><title>Column alias</title><link>http://www.a1vbcode.com/vbforums/Topic28232-14-1.aspx</link><description>&lt;DIV id=post_message_1342589&gt;&lt;DIV class=KonaBody&gt;I would like to put column aliases on some of the fields in the SELECT statement.&lt;BR&gt;&lt;BR&gt;Private Sub CommandButton1_Click()&lt;BR&gt;Dim NumList As String&lt;BR&gt;Dim SourceBook As Workbook&lt;BR&gt;Dim ListSheet As Worksheet&lt;BR&gt;Dim QuerySheet As Worksheet&lt;BR&gt;Dim Query As QueryTable&lt;BR&gt;Dim Numb As String&lt;BR&gt;&lt;BR&gt;Set SourceBook = Application.ActiveWorkbook&lt;BR&gt;Set ListSheet = SourceBook.Worksheets("Main")&lt;BR&gt;Set QuerySheet = SourceBook.Worksheets("MONEY")&lt;BR&gt;Numb = Range("H6")&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;If ListSheet.Cells(6, 8).Value = "" Then Exit Sub&lt;BR&gt;NumList = "'" &amp;amp; ListSheet.Cells(6, 8).Value &amp;amp; "'"&lt;BR&gt;&lt;BR&gt;Set Query = QuerySheet.QueryTables("MNY")&lt;BR&gt;Query.Sql = "SELECT NUMB_TBLE.NUMB_NAME, extract(month from NUMB_DATES_TBLE.DAY_MTH_YR) " _&lt;BR&gt;&amp;amp; "FROM JES.NUMB TBLE NUMB TBLE,&lt;BR&gt;JES.NUMB_DATES_TBLE NUMB_DATES_TBLE" _&lt;BR&gt;&amp;amp; "WHERE NUMB_TBLE.NUMB_ID = NUMB_DATES_TBLE.NUMB_ID AND NUMB_TBLE.NUMB_CODE IN (" &amp;amp; NumList &amp;amp; ") " _&lt;BR&gt;&amp;amp; "Group by numb_tble.numb_name, &lt;BR&gt;extract(month from NUMB_DATES_TBLE.DAY_MTH_YR)&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;Query.Refresh (False)&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;End Sub &lt;BR&gt;&lt;BR&gt;I want to alias the column NUMB_TBLE.NUMB_NAME, I want it to say LAST_NAME&lt;BR&gt;&lt;BR&gt;I have tried NUMB_TBLE.NUMB_NAME AS LAST_NAME. It works but it changes the order of the columns. I do not want the order of the columns to change.&lt;BR&gt;&lt;BR&gt;When the query runs, in Excel, the column headings are DAY_MTH_YR and LAST_NAME&lt;BR&gt;&lt;BR&gt;If I do not use the alias, the column headings in Excel are NUMB_NAME, DAY_MTH_YR.&lt;BR&gt;&lt;BR&gt;I want the order to still be Name of the person, Date of the transaction.&lt;BR&gt;&lt;BR&gt;When I use the alias, it becomes Date of the transaction, Name of the person&lt;BR&gt;&lt;BR&gt;The order changes.&lt;BR&gt;&lt;BR&gt;How do I alias the columns without effecting the order of the columns.&lt;BR&gt;&lt;BR&gt;I connect to the Oracle database and the result set is put into excel&lt;/DIV&gt;&lt;/DIV&gt;&lt;!-- / message --&gt;&lt;DIV style="MARGIN-TOP: 10px" align=right&gt;&lt;!-- controls --&gt;&lt;IMG id=progress_1342589 style="DISPLAY: none" alt="" src="http://www.xtremevbtalk.com/x_images/images/misc/progress.gif"&gt;&lt;/DIV&gt;</description><pubDate>Wed, 23 Sep 2009 13:26:02 GMT</pubDate><dc:creator>gencom99</dc:creator></item><item><title>RUN-TIME ERROR '1004' General OBDC Errror</title><link>http://www.a1vbcode.com/vbforums/Topic28228-14-1.aspx</link><description>&lt;OL&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;SPAN style="COLOR: #000099"&gt;Private&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000099"&gt;Sub&lt;/SPAN&gt; CommandButton1_Click&lt;SPAN style="COLOR: #66cc66"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #66cc66"&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;SPAN style="COLOR: #000099"&gt;Dim&lt;/SPAN&gt; NumList &lt;SPAN style="COLOR: #000099"&gt;As&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000099"&gt;String&lt;/SPAN&gt;&lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;SPAN style="COLOR: #000099"&gt;Dim&lt;/SPAN&gt; SourceBook &lt;SPAN style="COLOR: #000099"&gt;As&lt;/SPAN&gt; Workbook&lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;SPAN style="COLOR: #000099"&gt;Dim&lt;/SPAN&gt; ListSheet &lt;SPAN style="COLOR: #000099"&gt;As&lt;/SPAN&gt; Worksheet&lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;SPAN style="COLOR: #000099"&gt;Dim&lt;/SPAN&gt; QuerySheet &lt;SPAN style="COLOR: #000099"&gt;As&lt;/SPAN&gt; Worksheet&lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;SPAN style="COLOR: #000099"&gt;Dim&lt;/SPAN&gt; Query &lt;SPAN style="COLOR: #000099"&gt;As&lt;/SPAN&gt; QueryTable&lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;SPAN style="COLOR: #000099"&gt;Dim&lt;/SPAN&gt; Numb &lt;SPAN style="COLOR: #000099"&gt;As&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000099"&gt;String&lt;/SPAN&gt;&lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt; &lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;SPAN style="COLOR: #000099"&gt;Set&lt;/SPAN&gt; SourceBook = Application.&lt;SPAN&gt;ActiveWorkbook&lt;/SPAN&gt;&lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;SPAN style="COLOR: #000099"&gt;Set&lt;/SPAN&gt; ListSheet = SourceBook.&lt;SPAN&gt;Worksheets&lt;/SPAN&gt;&lt;SPAN style="COLOR: #66cc66"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #7f5f00"&gt;"Main"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #66cc66"&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;SPAN style="COLOR: #000099"&gt;Set&lt;/SPAN&gt; QuerySheet = SourceBook.&lt;SPAN&gt;Worksheets&lt;/SPAN&gt;&lt;SPAN style="COLOR: #66cc66"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #7f5f00"&gt;"MONEY"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #66cc66"&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;Numb = Range&lt;SPAN style="COLOR: #66cc66"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #7f5f00"&gt;"H6"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #66cc66"&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt; &lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;SPAN style="COLOR: #000099"&gt;If&lt;/SPAN&gt; ListSheet.&lt;SPAN&gt;Cells&lt;/SPAN&gt;&lt;SPAN style="COLOR: #66cc66"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #cc66cc"&gt;6&lt;/SPAN&gt;, &lt;SPAN style="COLOR: #cc66cc"&gt;8&lt;/SPAN&gt;&lt;SPAN style="COLOR: #66cc66"&gt;)&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt; = &lt;SPAN style="COLOR: #7f5f00"&gt;""&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000099"&gt;Then&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000099"&gt;Exit&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000099"&gt;Sub&lt;/SPAN&gt;&lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;NumList = &lt;SPAN style="COLOR: #7f5f00"&gt;"'"&lt;/SPAN&gt; &amp;amp; ListSheet.&lt;SPAN&gt;Cells&lt;/SPAN&gt;&lt;SPAN style="COLOR: #66cc66"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #cc66cc"&gt;6&lt;/SPAN&gt;, &lt;SPAN style="COLOR: #cc66cc"&gt;8&lt;/SPAN&gt;&lt;SPAN style="COLOR: #66cc66"&gt;)&lt;/SPAN&gt;.&lt;SPAN&gt;Value&lt;/SPAN&gt; &amp;amp; &lt;SPAN style="COLOR: #7f5f00"&gt;"'"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt; &lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;SPAN style="COLOR: #000099"&gt;Set&lt;/SPAN&gt; Query = QuerySheet.&lt;SPAN&gt;QueryTables&lt;/SPAN&gt;&lt;SPAN style="COLOR: #66cc66"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #7f5f00"&gt;"MNY"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #66cc66"&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;Query.&lt;SPAN&gt;Sql&lt;/SPAN&gt; = &lt;SPAN style="COLOR: #7f5f00"&gt;"SELECT NUMB_TBLE.NUMB_NAME, TO_CHAR(NUMB_DATES_TBLE.DAY_MTH_YR, 'MONTH'),  TO_CHAR(NUMB_DATES_TBLE.DAY_MTH_YR, 'YYYY'), SUM(NUMB_TBLE. PAY_IN), SUM(NUMB_TBLE. PAY_OUT),  SUM(NUMB_TBLE. NET_PAY)  "&lt;/SPAN&gt;_&lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&amp;amp; &lt;SPAN style="COLOR: #7f5f00"&gt;"FROM JES.NUMB TBLE NUMB TBLE,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;SPAN style="COLOR: #7f5f00"&gt;JES.NUMB_DATES_TBLE NUMB_DATES_TBLE"&lt;/SPAN&gt; _&lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&amp;amp; &lt;SPAN style="COLOR: #7f5f00"&gt;"WHERE NUMB_TBLE.NUMB_ID = NUMB_DATES_TBLE.NUMB_ID AND NUMB_TBLE.NUMB_CODE IN ("&lt;/SPAN&gt; &amp;amp; NumList &amp;amp; &lt;SPAN style="COLOR: #7f5f00"&gt;") "&lt;/SPAN&gt; _&lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&amp;amp; &lt;SPAN style="COLOR: #7f5f00"&gt;"Group by numb_tble.numb_name,  TO_CHAR(NUMB_DATES_TBLE.DAY_MTH_YR, 'YYYY'), TO_CHAR(NUMB_DATES_TBLE.DAY_MTH_YR, 'MONTH')&lt;/SPAN&gt;&lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;SPAN style="COLOR: #7f5f00"&gt;Query.Refresh (False)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;LI style="FONT-WEIGHT: normal; COLOR: black; FONT-STYLE: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;DIV style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;SPAN style="COLOR: #7f5f00"&gt;End Sub &lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;SPAN style="COLOR: #7f5f00"&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;SPAN style="COLOR: #7f5f00"&gt;When I add SUM(NUMB_TBLE. NET_PAY) to the code, I receive General ODBC error.&lt;BR&gt;&lt;BR&gt;Before I add this code, the query works.&lt;BR&gt;&lt;BR&gt;What is going on?&lt;BR&gt;&lt;BR&gt;How do I fix it? &lt;!-- / message --&gt;&lt;!-- edit note --&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="FONT-WEIGHT: normal; FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;SPAN style="COLOR: #7f5f00"&gt;&lt;/SPAN&gt; </description><pubDate>Wed, 23 Sep 2009 08:55:52 GMT</pubDate><dc:creator>gencom99</dc:creator></item><item><title>Run-Time Error '9' Subscript out of range</title><link>http://www.a1vbcode.com/vbforums/Topic28215-14-1.aspx</link><description>&lt;DIV id=post_message_3611508&gt;I am using a spreadsheet. It has two tabs MAIN and TOTAL CASH. On the MAIN tab is a BUTTON and a cell where to enter a number. After you put a number in the cell and click the button, the results of the query is in the tab TOTAL CASH&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;Private Sub CommandButton1_Click()&lt;BR&gt;Dim NumList As String&lt;BR&gt;Dim SourceBook As Workbook&lt;BR&gt;Dim ListSheet As Worksheet&lt;BR&gt;Dim QuerySheet As Worksheet&lt;BR&gt;Dim Query As QueryTable&lt;BR&gt;Dim Numb As String&lt;BR&gt;&lt;BR&gt;Set SourceBook = Application.ActiveWorkbook&lt;BR&gt;Set ListSheet = SourceBook.Worksheets("Main")&lt;BR&gt;Set QuerySheet = SourceBook.Worksheets("TOTAL CASH")&lt;BR&gt;Numb = Range("H6")&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;If ListSheet.Cells(6, 8).Value = "" Then Exit Sub&lt;BR&gt;NumList = "'" &amp;amp; ListSheet.Cells(6, 8).Value &amp;amp; "'"&lt;BR&gt;&lt;BR&gt;Set Query = QuerySheet.QueryTables("T_CASH")&lt;BR&gt;Query.Sql = "SELECT CUST_TBLE.NAME, CASH_TBLE.SAV_AMT " _&lt;BR&gt;&amp;amp; "FROM JES.CUST TBLE CUST TBLE,&lt;BR&gt;JES.CASH_TBLE CASH_TBLE" _&lt;BR&gt;&amp;amp; "WHERE CUST_TBLE.NUM_ID = CASH_TBLE.NUM_ID AND CUST_TBLE.NUM_CODE IN (" &amp;amp; NumList &amp;amp; ") " &lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;Query.Refresh (False)&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;End Sub&lt;BR&gt;&lt;BR&gt;This works.&lt;BR&gt;&lt;BR&gt;In a new workbook, I created two tabs, MAIN and MONEY. On the MAIN tab is a BUTTON and a cell where to enter a number. After you put a number in the cell and click the button, I want the results of the query in the tab TOTAL CASH. This is not working. This code is very simiar to the code above that works. The only difference is the query. I am getting this error: run-time error '9'-- Subscript out of range. This is the line with the error:&lt;BR&gt;Set Query = QuerySheet.QueryTables("MNY")&lt;BR&gt;&lt;BR&gt;Why does one code work, and the other code does not?&lt;BR&gt;&lt;BR&gt;This is the code that does not work.&lt;BR&gt;&lt;BR&gt;Private Sub CommandButton1_Click()&lt;BR&gt;Dim NumList As String&lt;BR&gt;Dim SourceBook As Workbook&lt;BR&gt;Dim ListSheet As Worksheet&lt;BR&gt;Dim QuerySheet As Worksheet&lt;BR&gt;Dim Query As QueryTable&lt;BR&gt;Dim Numb As String&lt;BR&gt;&lt;BR&gt;Set SourceBook = Application.ActiveWorkbook&lt;BR&gt;Set ListSheet = SourceBook.Worksheets("Main")&lt;BR&gt;Set QuerySheet = SourceBook.Worksheets("MONEY")&lt;BR&gt;Numb = Range("H6")&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;If ListSheet.Cells(6, 8).Value = "" Then Exit Sub&lt;BR&gt;NumList = "'" &amp;amp; ListSheet.Cells(6, 8).Value &amp;amp; "'"&lt;BR&gt;&lt;BR&gt;Set Query = QuerySheet.QueryTables("MNY")&lt;BR&gt;Query.Sql = "SELECT NUMB_TBLE.NUMB_NAME, extract(month from NUMB_DATES_TBLE.DAY_MTH_YR) " _&lt;BR&gt;&amp;amp; "FROM JES.NUMB TBLE NUMB TBLE,&lt;BR&gt;JES.NUMB_DATES_TBLE NUMB_DATES_TBLE" _&lt;BR&gt;&amp;amp; "WHERE NUMB_TBLE.NUMB_ID = NUMB_DATES_TBLE.NUMB_ID AND NUMB_TBLE.NUMB_CODE IN (" &amp;amp; NumList &amp;amp; ") " _&lt;BR&gt;&amp;amp; "Group by numb_tble.numb_name, &lt;BR&gt;extract(month from NUMB_DATES_TBLE.DAY_MTH_YR)&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;Query.Refresh (False)&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;End Sub &lt;/DIV&gt;&lt;!-- / message --&gt;</description><pubDate>Sun, 20 Sep 2009 14:15:20 GMT</pubDate><dc:creator>gencom99</dc:creator></item><item><title>Trouble with searching and displaying an array</title><link>http://www.a1vbcode.com/vbforums/Topic28154-14-1.aspx</link><description>Hey all, My name is Bill and i an a uni student. i am having trouble displaying the result of a search i am trying to put together.After clicking on the search button, my msgbox comes up saying that there are no matching record, but i know there is. the question is as follows:&lt;br&gt;Implement a search function so you can look up a part number in your table. Your search operation should return the result in a messageBox.&lt;br&gt;&lt;br&gt;here is my code:&lt;br&gt;&lt;br&gt;Public MyValue1 As String&lt;br&gt;Dim Formlength, looking As Integer&lt;br&gt;Public MyTable As Object&lt;br&gt;&lt;br&gt;Public MyValue1 As String&lt;br&gt;Dim Formlength, looking As Integer&lt;br&gt;Public MyTable As Object&lt;br&gt;&lt;br&gt;Private Sub Search_Button_Click()&lt;br&gt;Set MyTable = ActiveDocument.Tables(1)&lt;br&gt;Formlength = MyTable.Rows.Count&lt;br&gt;If looking &gt; Formlength Then&lt;br&gt;'reset looking if not first search&lt;br&gt;looking = 1&lt;br&gt;End If&lt;br&gt;If looking = 0 Then&lt;br&gt;'initialize looking for the first search&lt;br&gt;looking = 1&lt;br&gt;End If&lt;br&gt;MyValue1 = Search_String_1.Value&lt;br&gt;'get the search string&lt;br&gt;If MyValue1 = "" Then&lt;br&gt;MsgBox ("You have not entered a partnumber to search for!")&lt;br&gt;Unload UserForm1&lt;br&gt;Set MyTable = Nothing&lt;br&gt;Exit Sub&lt;br&gt;End If&lt;br&gt;Set MyTable = ActiveDocument.Tables(1)&lt;br&gt;looking = looking + 1&lt;br&gt;'increment in case the search function was exited early&lt;br&gt;Call findit&lt;br&gt;End Sub&lt;br&gt;Public Sub findit()&lt;br&gt;While looking &lt; Formlength + 1&lt;br&gt;'setup the loop&lt;br&gt;If MyValue1 = MyTable.Cell(looking, 1) Then&lt;br&gt;Debug.Print MyTable.Cell(looking, 1)&lt;br&gt;'if the search string is found in this cell&lt;br&gt;MyTable.Cell(looking, 1).Select&lt;br&gt;partnumberprint.Value = MyTable.Cell(looking, 1)&lt;br&gt;costprint.Value = MyTable.Cell(looking, 2)&lt;br&gt;quantityprint.Value = MyTable.Cell(looking, 3)&lt;br&gt;totalprint.Value = MyTable.Cell(looking, 4)&lt;br&gt;' print result in text box&lt;br&gt;Exit Sub&lt;br&gt;End If&lt;br&gt;looking = looking + 1&lt;br&gt;Wend&lt;br&gt;If looking &gt; Formlength Then&lt;br&gt;MsgBox ("End of records! Your searched record has not been found.")&lt;br&gt;looking = Formlength&lt;br&gt;'looking reset so it will be initialized correctly in the next search&lt;br&gt;Unload UserForm1&lt;br&gt;End If&lt;br&gt;End Sub&lt;br&gt;End Sub</description><pubDate>Sat, 05 Sep 2009 20:51:22 GMT</pubDate><dc:creator>Bill</dc:creator></item><item><title>how do i put a custom label on a link when creating an outlook task?</title><link>http://www.a1vbcode.com/vbforums/Topic27959-14-1.aspx</link><description>hi... i'm relatively new to outlook task creation from visual basic. hope someone can help me... when i create an outlook task, i want to insert a link with a custom string... e.g. please see screenshot: &lt;br&gt;&lt;br&gt;&lt;img src="http://img.photobucket.com/albums/v83/jldajo/outlooktask_test.jpg"&gt;&lt;br&gt;&lt;br&gt;instead of the left screen, i would like to come up with the right screen. any help, tips or sample code would be highly appreciated... thank you very much in advance.&lt;br&gt;&lt;br&gt;by the way, i'm using visual studio 2005, microsoft outlook 2003 and outlook interop from outlook 2003.&lt;br&gt;&lt;br&gt;-------------------&lt;br&gt;Imports xOutlook = Microsoft.Office.Interop.Outlook&lt;br&gt;&lt;br&gt;Public Class Form1&lt;br&gt;&lt;br&gt;    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click&lt;br&gt;        Dim xOutlookApp As New xOutlook.Application&lt;br&gt;        Dim xNameSpace As xOutlook.NameSpace = xOutlookApp.GetNamespace("MAPI")&lt;br&gt;        CreateTaskItem(xOutlookApp)&lt;br&gt;    End Sub&lt;br&gt;&lt;br&gt;    Private Sub CreateTaskItem(ByRef xOutlookApp As xOutlook.Application)&lt;br&gt;        Dim xNewTask As xOutlook.TaskItem = CType(xOutlookApp.CreateItem(xOutlook.OlItemType.olTaskItem), Microsoft.Office.Interop.Outlook.TaskItem)&lt;br&gt;&lt;br&gt;        xNewTask.Subject = "My Task " &amp; Now.ToString&lt;br&gt;        xNewTask.PercentComplete = 50&lt;br&gt;        xNewTask.StartDate = Date.Now&lt;br&gt;        xNewTask.DueDate = Date.Now.AddDays(5)&lt;br&gt;        xNewTask.Status = Microsoft.Office.Interop.Outlook.OlTaskStatus.olTaskInProgress&lt;br&gt;        xNewTask.Complete = False&lt;br&gt;&lt;br&gt;        '''' setting the task body&lt;br&gt;        xNewTask.Body = "Click &lt;a href='http://www.google.com'&gt;here&lt;/a&gt; to view google." _&lt;br&gt;            &amp; Environment.NewLine &amp; Environment.NewLine _&lt;br&gt;            &amp; "Test... http://www.google.com"&lt;br&gt;&lt;br&gt;        xNewTask.Save()&lt;br&gt;    End Sub&lt;br&gt;&lt;br&gt;End Class&lt;br&gt;---------------</description><pubDate>Thu, 30 Jul 2009 02:39:15 GMT</pubDate><dc:creator>tikboydev</dc:creator></item><item><title>Word - VBA script to display text on form</title><link>http://www.a1vbcode.com/vbforums/Topic27849-14-1.aspx</link><description>&lt;DIV class=”KonaBody”&gt;&lt;P style="MARGIN: 0px"&gt;I need to create a Word macro/vba script to display text to the right of a form field if a particular field value is select from the list of values. I currently have a script (Dropdown8 is a combo box, Text22 is a text box) that works (below), but only changes the text if, after changing the value in Dropdown8, you tab to another field and then reselect it a second time. Can someone help me to figure out what to do so that it(Text22) is updated each time the value in Dropdown8 is changed?&lt;BR&gt;&lt;BR&gt;&lt;/P&gt;&lt;DIV style="MARGIN: 5px 20px 20px"&gt;&lt;DIV class=smallfont style="MARGIN-BOTTOM: 2px"&gt;Code:&lt;/DIV&gt;&lt;PRE class=alt2 style="BORDER-RIGHT: 1px inset; PADDING-RIGHT: 6px; BORDER-TOP: 1px inset; PADDING-LEFT: 6px; PADDING-BOTTOM: 6px; MARGIN: 0px; OVERFLOW: auto; BORDER-LEFT: 1px inset; WIDTH: auto; PADDING-TOP: 6px; BORDER-BOTTOM: 1px inset; HEIGHT: 130px"&gt;&lt;DIV dir=ltr style="TEXT-ALIGN: left"&gt;Sub Dropdown8_Click()&lt;/DIV&gt;&lt;DIV dir=ltr style="TEXT-ALIGN: left"&gt;If ActiveDocument.FormFields("Dropdown8").Result = "Ogallala" Then &lt;/DIV&gt;&lt;DIV dir=ltr style="TEXT-ALIGN: left"&gt;ActiveDocument.FormFields("Text22").Result = "SAR Model Needed"&lt;/DIV&gt;&lt;DIV dir=ltr style="TEXT-ALIGN: left"&gt;Else&lt;/DIV&gt;&lt;DIV dir=ltr style="TEXT-ALIGN: left"&gt;ActiveDocument.FormFields("Text22").Result = " "&lt;/DIV&gt;&lt;DIV dir=ltr style="TEXT-ALIGN: left"&gt;End If&lt;/DIV&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description><pubDate>Mon, 29 Jun 2009 12:45:09 GMT</pubDate><dc:creator>Barry</dc:creator></item><item><title>Attachmate WRQ Reflection Programming</title><link>http://www.a1vbcode.com/vbforums/Topic27766-14-1.aspx</link><description>Hi,&lt;/P&gt;&lt;P&gt;I am working on WRQ reflection (For Unix and OpenVMS).&lt;/P&gt;&lt;P&gt;I am trying to copy a particular text content from a screen and write it into a word &amp;#100;ocument.&lt;/P&gt;&lt;P&gt;Following is the code which is able to copy the entire contents into a word &amp;#100;ocument.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Sub SendDisplayInfoToWord()&lt;BR&gt;Dim displayText As String&lt;BR&gt;With Session&lt;BR&gt;'Get text from the screen display&lt;BR&gt;'For Reflection for HP, UNIX and OpenVMS, RegGis Graphics:&lt;BR&gt;&lt;STRONG&gt;&lt;FONT color=#dd1111&gt;displayText = .GetText(.ScreenTopRow, 0, _&lt;BR&gt;.ScreenTopRow + .DisplayColumns, .DisplayColumns)&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR&gt;'For Reflection for IBM:&lt;BR&gt;'displayText = .GetDisplayText(1, 1, _&lt;BR&gt;'.DisplayColumns * .DisplayRows)&lt;BR&gt;End With&lt;BR&gt;'Create a Word object&lt;BR&gt;Dim Word as Word.Application&lt;BR&gt;Set Word = CreateObject("Word.Application")&lt;BR&gt;'Make Word visible and create a new document&lt;BR&gt;Word.Visible = True&lt;BR&gt;Word.Documents.Add&lt;BR&gt;'Add the display text to the document&lt;BR&gt;Word.Selection.TypeText Text:=displayText&lt;BR&gt;'Save the document and quit Word&lt;BR&gt;Word.ActiveDocument.SaveAs Filename:="C:\MySample.doc"&lt;BR&gt;Word.Quit&lt;BR&gt;End Sub&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;How do I use it to get a particular content say only from a row Eg. contents from the 3rd row (3,1) to (3,10)?&lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;/EM&gt; </description><pubDate>Tue, 09 Jun 2009 01:59:36 GMT</pubDate><dc:creator>DavidJ_John</dc:creator></item><item><title>Visual Basic Help!</title><link>http://www.a1vbcode.com/vbforums/Topic27720-14-1.aspx</link><description>I dont know where to start! &lt;img align="absmiddle" src="http://www.a1vbcode.com/vbforums/Skins/Classic/Images/EmotIcons/Smile.gif" border="0" title="Smile"&gt;&lt;/P&gt;&lt;P&gt;I work for a call centre and each advisor logs information during each call. I currently use a spreadsheet for each advisor each day and as you can imagine at the end of the week i have hundreds to go throught and produce a report from.&lt;/P&gt;&lt;P&gt;Does anyone have a template that i can amend which stores all this data for me and for me to then run a report to get the information i want/need. eg the advisor enters the information and for this to be saved somewhere.&lt;/P&gt;&lt;P&gt;As this will be available to hundreds of users i need a login page for each advisor to login to so i know its them.&lt;/P&gt;&lt;P&gt;Im very new to all this, could a program store/retreive information in excel templates.&lt;/P&gt;&lt;P&gt;I am using Microsoft Visual Basic Express Editions 2008 until im more confident in programming.......&lt;/P&gt;&lt;P&gt;Any help would be very much grateful and this will save me hours and hours of work each week printing off and going through spreadsheets!</description><pubDate>Wed, 27 May 2009 09:17:00 GMT</pubDate><dc:creator>damian1985</dc:creator></item><item><title>Problem with Hyperlinks.Add</title><link>http://www.a1vbcode.com/vbforums/Topic27652-14-1.aspx</link><description>&lt;DIV class=body itxtvisited="1"&gt; Derar evetybody&lt;/DIV&gt;&lt;DIV class=body itxtvisited="1"&gt; &lt;BR&gt;here is my code which copy an existting sheet and make a hyperlink to it in the main sheet with friendly name.&lt;BR&gt;but when press the button of that form i always have a error messeage, and the compiler stope at the hyperlink line code.&lt;BR&gt;&lt;BR&gt;the message tell am that the add mwthode for hyperlink is faild.&lt;BR&gt;&lt;BR&gt;anyhelp&lt;BR&gt;&lt;/DIV&gt;&lt;P&gt;&lt;pre&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff&gt;Private&lt;/FONT&gt; &lt;FONT color=blue&gt;Sub&lt;/FONT&gt; cmdOKNewCust_Click() &lt;BR&gt;    &lt;FONT color=blue&gt;Dim&lt;/FONT&gt; strCustName &lt;FONT color=blue&gt;As&lt;/FONT&gt; &lt;FONT color=blue&gt;String&lt;/FONT&gt; &lt;BR&gt;    &lt;FONT color=blue&gt;Dim&lt;/FONT&gt; FirstPeriodSum &lt;FONT color=blue&gt;As&lt;/FONT&gt; &lt;FONT color=blue&gt;Double&lt;/FONT&gt; &lt;BR&gt;    &lt;FONT color=blue&gt;Dim&lt;/FONT&gt; sbAdd &lt;FONT color=blue&gt;As&lt;/FONT&gt; &lt;FONT color=blue&gt;String&lt;/FONT&gt; &lt;BR&gt;    &lt;FONT color=blue&gt;Dim&lt;/FONT&gt; scTip &lt;FONT color=blue&gt;As&lt;/FONT&gt; &lt;FONT color=blue&gt;String&lt;/FONT&gt; &lt;BR&gt;    &lt;FONT color=blue&gt;Dim&lt;/FONT&gt; txToDsply &lt;FONT color=blue&gt;As&lt;/FONT&gt; &lt;FONT color=blue&gt;String&lt;/FONT&gt; &lt;BR&gt;    &lt;FONT color=blue&gt;Dim&lt;/FONT&gt; Cust_Sheet_Name &lt;FONT color=blue&gt;As&lt;/FONT&gt; &lt;FONT color=blue&gt;String&lt;/FONT&gt; &lt;BR&gt;    &lt;FONT color=blue&gt;Dim&lt;/FONT&gt; Cust_Number &lt;FONT color=blue&gt;As&lt;/FONT&gt; &lt;FONT color=blue&gt;Integer&lt;/FONT&gt; &lt;BR&gt;    &lt;FONT color=blue&gt;Dim&lt;/FONT&gt; j &lt;FONT color=blue&gt;As&lt;/FONT&gt; &lt;FONT color=blue&gt;Integer&lt;/FONT&gt; &lt;BR&gt;    &lt;FONT color=blue&gt;Dim&lt;/FONT&gt; i &lt;FONT color=blue&gt;As&lt;/FONT&gt; &lt;FONT color=blue&gt;Integer&lt;/FONT&gt; &lt;BR&gt;    &lt;FONT color=blue&gt;Dim&lt;/FONT&gt; strReceipt &lt;FONT color=blue&gt;As&lt;/FONT&gt; &lt;FONT color=blue&gt;String&lt;/FONT&gt;, strGPhone &lt;FONT color=blue&gt;As&lt;/FONT&gt; &lt;FONT color=blue&gt;String&lt;/FONT&gt;, strMobile &lt;FONT color=blue&gt;As&lt;/FONT&gt; &lt;FONT color=blue&gt;String&lt;/FONT&gt;, strFax &lt;FONT color=blue&gt;As&lt;/FONT&gt; &lt;FONT color=blue&gt;String&lt;/FONT&gt;, strAddress &lt;FONT color=blue&gt;As&lt;/FONT&gt; &lt;FONT color=blue&gt;String&lt;/FONT&gt; &lt;BR&gt;     &lt;FONT color=darkgreen&gt;'Cust Name Check&lt;/FONT&gt;&lt;BR&gt;    &lt;FONT color=blue&gt;If&lt;/FONT&gt; txtCustName &amp;lt;&amp;gt; "" &lt;FONT color=blue&gt;Then&lt;/FONT&gt; &lt;BR&gt;        strCustName = txtCustName &lt;BR&gt;    &lt;FONT color=blue&gt;Else&lt;/FONT&gt; &lt;BR&gt;        MsgBox "No name", vbOKOnly, "try again" &lt;BR&gt;        txtCustName.SetFocus &lt;BR&gt;        Exit &lt;FONT color=blue&gt;Sub&lt;/FONT&gt; &lt;BR&gt;    &lt;FONT color=blue&gt;End&lt;/FONT&gt; &lt;FONT color=blue&gt;If&lt;/FONT&gt; &lt;BR&gt;     &lt;BR&gt;     &lt;FONT color=darkgreen&gt;'Fist Account&lt;/FONT&gt;&lt;BR&gt;    &lt;FONT color=blue&gt;If&lt;/FONT&gt; txtCustFirstPeriod = "" &lt;FONT color=blue&gt;Then&lt;/FONT&gt; &lt;BR&gt;        FirstPeriodSum = 0 &lt;BR&gt;    &lt;FONT color=blue&gt;Else&lt;/FONT&gt; &lt;BR&gt;        FirstPeriodSum = txtCustFirstPeriod &lt;BR&gt;    &lt;FONT color=blue&gt;End&lt;/FONT&gt; &lt;FONT color=blue&gt;If&lt;/FONT&gt; &lt;BR&gt;    strReceipt = txtReceiptNum &lt;BR&gt;    strGPhone = txtCustGPhone &lt;BR&gt;    strMobile = txtCustMobile &lt;BR&gt;    strFax = txtCustFax &lt;BR&gt;    strAddress = txtCustAddress &lt;BR&gt;     &lt;FONT color=darkgreen&gt;'&lt;/FONT&gt;&lt;BR&gt;    Application.ScreenUpdating = &lt;FONT color=blue&gt;False&lt;/FONT&gt; &lt;BR&gt;     &lt;BR&gt;     &lt;FONT color=darkgreen&gt;'Copy Cust Sheet&lt;/FONT&gt;&lt;BR&gt;    Sheets("Cust").Copy After:=Sheets("Customers") &lt;BR&gt;     &lt;FONT color=darkgreen&gt;'change new sheet name&lt;/FONT&gt;&lt;BR&gt;    Cust_Sheet_Name = "c" &amp;amp; Application.Sheets.Count + 1 &lt;BR&gt;     &lt;BR&gt;     &lt;FONT color=darkgreen&gt;'check new sheet name&lt;/FONT&gt;&lt;BR&gt;    &lt;FONT color=blue&gt;For&lt;/FONT&gt; j = 1 &lt;FONT color=blue&gt;To&lt;/FONT&gt; ActiveWorkbook.Sheets.Count &lt;BR&gt;        &lt;FONT color=blue&gt;If&lt;/FONT&gt; Cust_Sheet_Name = ActiveWorkbook.Sheets(j).Name &lt;FONT color=blue&gt;Then&lt;/FONT&gt; &lt;BR&gt;            Cust_Sheet_Name = "c" &amp;amp; Application.Sheets.Count + Int(Rnd() * 10) &lt;BR&gt;            j = 1 &lt;BR&gt;        &lt;FONT color=blue&gt;End&lt;/FONT&gt; &lt;FONT color=blue&gt;If&lt;/FONT&gt; &lt;BR&gt;    &lt;FONT color=blue&gt;Next&lt;/FONT&gt; &lt;BR&gt;     &lt;FONT color=darkgreen&gt;'change sheet name&lt;/FONT&gt;&lt;BR&gt;    ActiveSheet.Name = Cust_Sheet_Name &lt;BR&gt;     &lt;FONT color=darkgreen&gt;'fill some field&lt;/FONT&gt;&lt;BR&gt;    ActiveSheet.Range("A5") = "Mr." &amp;amp; Trim(strCustName) &lt;BR&gt;    ActiveSheet.Range("B11").Value = FirstPeriodSum &lt;BR&gt;    ActiveSheet.Range("D11").Value = strReceipt &lt;BR&gt;    ActiveSheet.Range("E11").Value = "Bill" &lt;BR&gt;    ActiveSheet.Range("F11").Value = Format(Now(), "dd/mm/yyyy") &lt;BR&gt;     &lt;FONT color=darkgreen&gt;'First account border&lt;/FONT&gt;&lt;BR&gt;    ActiveSheet.Range("b11:f11").Select &lt;BR&gt;    &lt;FONT color=blue&gt;With&lt;/FONT&gt; Selection.Borders(xlEdgeBottom) &lt;BR&gt;        .LineStyle = xlContinuous &lt;BR&gt;        .Weight = xlMedium &lt;BR&gt;        .ColorIndex = xlAutomatic &lt;BR&gt;    &lt;FONT color=blue&gt;End With&lt;/FONT&gt; &lt;BR&gt;     &lt;BR&gt;     &lt;FONT color=darkgreen&gt;'_____Customers Sheet_____&lt;/FONT&gt;&lt;BR&gt;    Sheets("Customers").Activate &lt;BR&gt;    &lt;FONT color=blue&gt;If&lt;/FONT&gt; &lt;FONT color=blue&gt;Not&lt;/FONT&gt; IsNull(Sheets("Customers").Range("B500").End(xlUp)) &lt;FONT color=blue&gt;Then&lt;/FONT&gt; &lt;BR&gt;        i = Sheets("Customers").Range("B500").End(xlUp).Offset(1, 0).Row &lt;BR&gt;    &lt;FONT color=blue&gt;Else&lt;/FONT&gt; &lt;BR&gt;        i = Sheets("Customers").Range("B500").End(xlUp).Row &lt;BR&gt;    &lt;FONT color=blue&gt;End&lt;/FONT&gt; &lt;FONT color=blue&gt;If&lt;/FONT&gt; &lt;BR&gt;     &lt;FONT color=darkgreen&gt;'&lt;/FONT&gt;&lt;BR&gt;    sbAdd = Cust_Sheet_Name &amp;amp; "!A5" &lt;BR&gt;    scTip = "Go to Ctstomer " &amp;amp; strCustName &lt;BR&gt;    txToDsply = strCustName &lt;BR&gt;     &lt;BR&gt;    &lt;B&gt;&lt;FONT color=darkgreen&gt;'the hyperlink&lt;/B&gt;&lt;/FONT&gt;&lt;BR&gt;    &lt;B&gt;With Application.Sheets("Customers")&lt;/B&gt; &lt;BR&gt;    &lt;B&gt;.Hyperlinks.Add Anchor:=.Range("B" &amp;amp; i), Address:="", SubAddress:=sbAdd, ScreenTip:=scTip, TextToDisplay:=txToDsply&lt;/B&gt; &lt;BR&gt;    &lt;B&gt;End With&lt;/B&gt; &lt;BR&gt;     &lt;BR&gt;     &lt;BR&gt;     &lt;FONT color=darkgreen&gt;'Cust Account past&lt;/FONT&gt;&lt;BR&gt;    Sheets("Customers").Activate &lt;BR&gt;    ActiveSheet.Range("C" &amp;amp; i).Select &lt;BR&gt;    ActiveCell.Formula = "=" &amp;amp; Cust_Sheet_Name &amp;amp; "!$C$5" &lt;BR&gt;     &lt;FONT color=darkgreen&gt;'format the account&lt;/FONT&gt;&lt;BR&gt;    &lt;FONT color=blue&gt;With&lt;/FONT&gt; Selection.Font &lt;BR&gt;         &lt;FONT color=darkgreen&gt;'.Name = Arial&lt;/FONT&gt;&lt;BR&gt;        .Size = 13 &lt;BR&gt;        .Bold = &lt;FONT color=blue&gt;True&lt;/FONT&gt; &lt;BR&gt;        .Underline = &lt;FONT color=blue&gt;False&lt;/FONT&gt; &lt;BR&gt;        Selection.Style = "Comma" &lt;BR&gt;        Selection.NumberFormat = "_-* #,##0_-;_-* #,##0-;_-* ""-""??_-;_-@_-" &lt;BR&gt;    &lt;FONT color=blue&gt;End With&lt;/FONT&gt; &lt;BR&gt;     &lt;BR&gt;     &lt;FONT color=darkgreen&gt;'resotr customers sheet&lt;/FONT&gt;&lt;BR&gt;    &lt;FONT color=blue&gt;Call&lt;/FONT&gt; Cust_Names_Sort &lt;BR&gt;     &lt;BR&gt;     &lt;FONT color=darkgreen&gt;'reFill the serial num&lt;/FONT&gt;&lt;BR&gt;    Cust_Number = Sheets("Customers").Range("Customers_List").Count &lt;BR&gt;    i = 10 &lt;BR&gt;    &lt;FONT color=blue&gt;For&lt;/FONT&gt; j = 1 &lt;FONT color=blue&gt;To&lt;/FONT&gt; Cust_Number &lt;BR&gt;        ActiveSheet.Range("A" &amp;amp; i).Value = j &lt;BR&gt;        i = i + 1 &lt;BR&gt;    &lt;FONT color=blue&gt;Next&lt;/FONT&gt; j &lt;BR&gt;     &lt;BR&gt;     &lt;FONT color=darkgreen&gt;'_________ AlDaleel Sheet ________&lt;/FONT&gt;&lt;BR&gt;    Sheets("Daleel").Activate &lt;BR&gt;    &lt;FONT color=blue&gt;If&lt;/FONT&gt; &lt;FONT color=blue&gt;Not&lt;/FONT&gt; IsNull(Sheets("Daleel").Range("B1000").End(xlUp)) &lt;FONT color=blue&gt;Then&lt;/FONT&gt; &lt;BR&gt;        i = Sheets("Daleel").Range("B1000").End(xlUp).Offset(1, 0).Row &lt;BR&gt;    &lt;FONT color=blue&gt;Else&lt;/FONT&gt; &lt;BR&gt;        i = Sheets("Daleel").Range("B10500").End(xlUp).Row &lt;BR&gt;    &lt;FONT color=blue&gt;End&lt;/FONT&gt; &lt;FONT color=blue&gt;If&lt;/FONT&gt; &lt;/P&gt;&lt;P&gt;ActiveSheet.Range("A" &amp;amp; i).Value = "Ò" &lt;/P&gt;&lt;P&gt;ActiveSheet.Range("B" &amp;amp; i).Value = strCustName &lt;/P&gt;&lt;P&gt;ActiveSheet.Range("C" &amp;amp; i) = strGPhone &lt;/P&gt;&lt;P&gt;ActiveSheet.Range("D" &amp;amp; i) = strMobile &lt;/P&gt;&lt;P&gt;ActiveSheet.Range("E" &amp;amp; i) = strFax &lt;/P&gt;&lt;P&gt;ActiveSheet.Range("F" &amp;amp; i) = strAddress &lt;/P&gt;&lt;P&gt;&lt;FONT color=darkgreen&gt;'Resort al-daleel&lt;/FONT&gt;&lt;BR&gt;    &lt;FONT color=blue&gt;Call&lt;/FONT&gt; Sort_Phone &lt;BR&gt;     &lt;FONT color=darkgreen&gt;'&lt;/FONT&gt;&lt;BR&gt;    Application.ScreenUpdating = &lt;FONT color=blue&gt;True&lt;/FONT&gt; &lt;BR&gt;    Unload frmNewCust &lt;BR&gt;    Sheets(Cust_Sheet_Name).Activate &lt;BR&gt;    MsgBox "Add: " &amp;amp; vbCrLf &amp;amp; "Cust: " &amp;amp; strCustName &amp;amp; vbCrLf &amp;amp; "Successfuly", , "message" &lt;BR&gt;     &lt;FONT color=darkgreen&gt;'empty frmNewCust fields&lt;/FONT&gt;&lt;BR&gt;    txtCustName = "" &lt;BR&gt;    txtCustFirstPeriod = "" &lt;BR&gt;    txtReceiptNum = "" &lt;BR&gt;    txtCustGPhone = "" &lt;BR&gt;    txtCustMobile = "" &lt;BR&gt;    txtCustFax = "" &lt;BR&gt;    txtCustAddress = "" &lt;BR&gt;&lt;FONT color=blue&gt;End Sub&lt;/FONT&gt; &lt;/P&gt;&lt;P&gt;&lt;/pre&gt;&lt;P&gt;I'm using MS Excel 2007&lt;BR&gt;and the unreadding text here that becouse of copy past and it's just string ""</description><pubDate>Sun, 10 May 2009 02:56:03 GMT</pubDate><dc:creator>ferasferas</dc:creator></item><item><title>Validate the Range</title><link>http://www.a1vbcode.com/vbforums/Topic27550-14-1.aspx</link><description>I need a code for this statement&lt;br&gt;&lt;br&gt;i created two text box. one for input and other for output&lt;br&gt;&lt;br&gt;If the input value is between 1 to 10 (it means the value may be 1 or 2 or 3 or 4 etc.....) then it need to show "A" in output&lt;br&gt;&lt;br&gt;similarly If the input value is between 11 to 20 then it need to show "B" in output&lt;br&gt;&lt;br&gt;Thanks in advance for the code&lt;br&gt;</description><pubDate>Thu, 23 Apr 2009 05:49:12 GMT</pubDate><dc:creator>rajeshjm</dc:creator></item><item><title>Not able to update a Table using Access VBA</title><link>http://www.a1vbcode.com/vbforums/Topic27454-14-1.aspx</link><description>Hi all,&lt;BR&gt;I am a beginner in Access VBA. &lt;BR&gt;I have an issue in updating a Table in the VBA code.&lt;/P&gt;&lt;P&gt;&lt;BR&gt;I am reading a text file in this VBA code and extracting the message IDs from the file and write some comment for the message ID.&lt;BR&gt;I am trying to update the message ID and the comment to the Table "Result" using the below code. It is giving me Run time error - 3001. Invalid Argument.&lt;BR&gt;it stops at the line Rslt.Updtae.&lt;/P&gt;&lt;P&gt;Dim db As Database&lt;BR&gt;Dim Rslt As Recordset&lt;BR&gt;Set db = CurrentDb()&lt;BR&gt;Set Rslt = db.OpenRecordset("Result")&lt;BR&gt;Rslt.AddNew&lt;BR&gt;Rslt("Field1") = msg_id&lt;BR&gt;Rslt("Field2") = comment&lt;BR&gt;Rslt.Update&lt;/P&gt;&lt;P&gt;&lt;BR&gt;Please some one help me to overcome this. It was working fine before. Now its giving error. Donno where I ve gone wrong.&lt;/P&gt;&lt;P&gt;&lt;BR&gt;Thanks,&lt;BR&gt;Arasi</description><pubDate>Wed, 15 Apr 2009 08:07:58 GMT</pubDate><dc:creator>Arasi</dc:creator></item><item><title>VBA .enabled property use on Tab Control's "On Change" event</title><link>http://www.a1vbcode.com/vbforums/Topic27443-14-1.aspx</link><description>&lt;PRE class=WNPost style="WORD-WRAP: break-word"&gt;I have a Tab Control, "TabCt", which includes two Tabs (aka Pages) containing subforms(irrelevent though), "Tab1" and "Tab2".  This is on a main form, "Form1", which includes a text box "txtbox" (names for example only).  I would like to have the text box appear only when "Tab1" is selected/active, but not for "Tab2".  There are limited options in the event properties for tab controls, so I have chosen to run the code (below) based on the 'On Change' property.  Currently, based on the code below, the text box disappears when selecting either tab.  I am reaching out for help in adjusting my code (below) to work correctly.  I am wondering if possibly the code needs to be adjusted so that it is not tied to the 'On Change' tab control property as well, but I do not know how to adjust it so.  I read in Help that the Enabled Property applies to Tab Control groups (therefore I wonder if it cannot apply to individual tabs).Private Sub TabCt_Change()Dim txtbox As TextBoxSet txtbox= [Forms]![Form1]![txtbox]  'because it is on the main formIf Me!Tab2.Enabled Then    txtbox .Visible = False Else    txtbox.Visible = TrueEnd IfEnd Sub&lt;/PRE&gt;</description><pubDate>Mon, 13 Apr 2009 17:03:25 GMT</pubDate><dc:creator>Barry</dc:creator></item><item><title>Access Query not work</title><link>http://www.a1vbcode.com/vbforums/Topic27395-14-1.aspx</link><description>All,&lt;P&gt;below is the Access 2003 Query, written for find out only those records where the employer name in "Data" Table is not Equal to Emplyer name in "CCM" table. but it not working pls Check &amp;amp; Correct it.&lt;/P&gt;&lt;P&gt;SELECT Data.CUSTOMER_NO, Data.CUSTOMERNAME, CCM.Category, Data.CONSTITUTION, CCM.EMPLOYERNAME, Data.BRANCH_NAME, Data.DECISION_Date&lt;BR&gt;FROM Data, CCM&lt;BR&gt;WHERE (((Data.EMPLOYERNAME)&amp;lt;&amp;gt;[ccm].[employername]))&lt;BR&gt;GROUP BY Data.CUSTOMER_NO, Data.CUSTOMERNAME, CCM.Category, Data.CONSTITUTION, CCM.EMPLOYERNAME, Data.BRANCH_NAME, Data.DECISION_Date&lt;BR&gt;HAVING (((Data.CONSTITUTION)&amp;lt;&amp;gt;"SALARIED CATEGORY C"));</description><pubDate>Tue, 07 Apr 2009 11:17:35 GMT</pubDate><dc:creator>Aleon</dc:creator></item><item><title>Access 2003 - Code does not force equal values in two text boxes</title><link>http://www.a1vbcode.com/vbforums/Topic27284-14-1.aspx</link><description>I have converted a macro to VBA because I was getting an error message that "Echo=Off" or "Setwarnings=No" could neither suppress.  I then changed the "On Error GoTo" line set to "0", which resolved the error message problem.  Now, though, it does not force the Well Location value to equal that of the value in Comb box 34 (Combo34) any longer.  Anyone know what I may add to the script (below) to force the Well Location value to equal what is visible (selected) in the combo box?&lt;/P&gt;&lt;P&gt;Function Forms_UpdateWellID()&lt;BR&gt;On Error GoTo 0&lt;/P&gt;&lt;P&gt;    DoCmd.Echo False, ""&lt;BR&gt;    DoCmd.SetWarnings False&lt;BR&gt;    ' Updates new Well Location record in frmWellMaintenanceSub based on what is visible in Combo box 34&lt;BR&gt;    Forms!frmWellMaintenance!frmWellMaintenanceSub.Form![Well Location] = Forms!frmWellMaintenance!Combo34&lt;/P&gt;&lt;P&gt;&lt;BR&gt;Forms_UpdateWellID_Exit:&lt;BR&gt;    Exit Function&lt;/P&gt;&lt;P&gt;End Function</description><pubDate>Fri, 20 Mar 2009 11:30:10 GMT</pubDate><dc:creator>Barry</dc:creator></item><item><title>radio link design using a visual basic</title><link>http://www.a1vbcode.com/vbforums/Topic27123-14-1.aspx</link><description>&lt;STRONG&gt;hi, everyone,  actually i am doing a MSc Project based on visua basic 6, which is to design a radio link software. and, i am stucked in three things, which are-&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1) how to create a link from one window to other(that is, from, form1 to other form)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2) how to keep the record of different values once calculated in a table&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;3) and, how to draw a graph in other window (which should be displayed once in a click from form1 to other)&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;ANY HELP WILL BE APPRECIATED............THANKS FOR YOUR TIME</description><pubDate>Wed, 25 Feb 2009 09:23:05 GMT</pubDate><dc:creator>forumstar</dc:creator></item><item><title>Help me in my project</title><link>http://www.a1vbcode.com/vbforums/Topic23318-14-1.aspx</link><description>Help me in my project</description><pubDate>Mon, 15 Oct 2007 09:11:20 GMT</pubDate><dc:creator>nader</dc:creator></item><item><title>Runtime Error 5 - Call/Argument? VB noob!</title><link>http://www.a1vbcode.com/vbforums/Topic27062-14-1.aspx</link><description>As this post will illustrate, I'm a total VBA noob. I've been trying to write an interative solver for a system of equations, using a 'do while...." loop. The program seems to disagree that my variable inputs are valid, I'm currently assigning variables from a spreadsheet using the 'range' function.&lt;br&gt;&lt;br&gt;Currently the debugger flags the bolded line with Error 5 - Invalid Call or Argument&lt;br&gt;&lt;br&gt;Any input very apprecaited, I'm stumped.&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;The Code&lt;br&gt;----------------------------------------------------------------------&lt;br&gt;&lt;br&gt;Option Explicit&lt;br&gt;Sub Iterate_PEMU_Parameters()&lt;br&gt;'Iterative solver to solve equilibria equations; specifically designed for PEMU films&lt;br&gt;&lt;br&gt;'Assign Variables&lt;br&gt;Dim Kp As Double, Ki As Double, Cs As Double 'Constants&lt;br&gt;Dim F As Double, P As Double, I As Double 'where X = Px, representing the polymers in different forms&lt;br&gt;Dim F0 As Double, P0 As Double, I0 As Double 'old values of above&lt;br&gt;Dim C As Double 'Concentration of Ions&lt;br&gt;Dim y As Double 'Activity Coefficient&lt;br&gt;Dim x As Double, z As Double 'Changes in Concentration&lt;br&gt;Dim h As Double, k As Double, o As Double 'Film Thickness, Swelling Constant, old thickness (h0)&lt;br&gt;Dim ConvergeFlag As Boolean 'Convergence Flag&lt;br&gt;Dim Counter As Double, OldCounter As Double 'Iteration Counter&lt;br&gt;&lt;br&gt;'Retrieve Initial Inputs&lt;br&gt;Kp = Worksheets("Sheet1").Range("B1").Value&lt;br&gt;Ki = Worksheets("Sheet1").Range("B2").Value&lt;br&gt;Cs = Worksheets("Sheet1").Range("B3").Value&lt;br&gt;F = Worksheets("Sheet1").Range("B4").Value&lt;br&gt;P = Worksheets("Sheet1").Range("B5").Value&lt;br&gt;I = Worksheets("Sheet1").Range("B6").Value&lt;br&gt;&lt;br&gt;ConvergeFlag = 0&lt;br&gt;Counter = 0&lt;br&gt;&lt;br&gt;'Set h to 1&lt;br&gt;k = (F + I) / P&lt;br&gt;h = 1&lt;br&gt;o = 1&lt;br&gt;&lt;br&gt;'Iterative Loop&lt;br&gt;Do While ConvergeFlag = 0&lt;br&gt;&lt;br&gt;'Equations for one iteration&lt;br&gt;y = 10 ^ (-0.51 * Sqr(F + Cs))&lt;br&gt;&lt;br&gt;&lt;b&gt;x = (-(4 * y * F + P) - Sqr((4 * y * F + Kp) ^ 2 - 4 * (4 * y) * (y * (F ^ 2) - Kp * P))) / (2 * 4 * y)&lt;/b&gt;&lt;br&gt;    If x &lt; 0 Then&lt;br&gt;        x = (-(4 * y * F + P) - Sqr((4 * y * F + Kp) ^ 2 - 4 * (4 * y) * (y * (F ^ 2) - Kp * P))) / (2 * 4 * y)&lt;br&gt;    Else&lt;br&gt;End If&lt;br&gt;&lt;br&gt;z = (-(-y * Cs - y * F - Ki) - Sqr((-y * Cs - y * F - Ki) ^ 2 - 4 * (y) * (y * F * Cs - Ki * I))) / (2 * y)&lt;br&gt;    If z &lt; 0 Then&lt;br&gt;        z = (-(-y * Cs - y * F - Ki) + Sqr((-y * Cs - y * F - Ki) ^ 2 - 4 * (y) * (y * F * Cs - Ki * I))) / (2 * y)&lt;br&gt;    Else&lt;br&gt;End If&lt;br&gt;&lt;br&gt;'Store New Values&lt;br&gt;F = F + 2 * x - z&lt;br&gt;P = P - x&lt;br&gt;I = I + z&lt;br&gt;&lt;br&gt;'Calculate new Thickness&lt;br&gt;o = h&lt;br&gt;h = k * (2 * P) / (F + I)&lt;br&gt;&lt;br&gt;'Correct for Concentrations&lt;br&gt;F0 = F&lt;br&gt;F = F0 * (h / o)&lt;br&gt;P0 = P&lt;br&gt;P = P0 * (h / o)&lt;br&gt;I0 = I&lt;br&gt;I = I0 * (h / o)&lt;br&gt;&lt;br&gt;'Convergence Test&lt;br&gt;If x &lt; 0.0001 And y &lt; 0.0001 Then ConvergeFlag = 1&lt;br&gt;&lt;br&gt;'Count Iterations&lt;br&gt;OldCounter = Counter&lt;br&gt;Counter = OldCounter + 1&lt;br&gt;&lt;br&gt;If Counter &gt; 100000 Then&lt;br&gt;    MsgBox "Iteration limit reached. Guess better next time, noob!", 48&lt;br&gt;    ConvergeFlag = 1&lt;br&gt;End If&lt;br&gt;&lt;br&gt;Loop&lt;br&gt;&lt;br&gt;'Report Answers&lt;br&gt;Worksheets("sheet1").Range("D1").Value = ("Results")&lt;br&gt;Worksheets("sheet1").Range("D2").Value = ("Pf")&lt;br&gt;Worksheets("sheet1").Range("D3").Value = ("Pp")&lt;br&gt;Worksheets("sheet1").Range("D4").Value = ("Pi")&lt;br&gt;Worksheets("sheet1").Range("D5").Value = ("h")&lt;br&gt;Worksheets("sheet1").Range("D6").Value = ("y")&lt;br&gt;Worksheets("sheet1").Range("D7").Value = ("Ks")&lt;br&gt;Worksheets("sheet1").Range("D8").Value = ("Iterations")&lt;br&gt;&lt;br&gt;Worksheets("sheet1").Range("E2").Value = F&lt;br&gt;Worksheets("sheet1").Range("E3").Value = P&lt;br&gt;Worksheets("sheet1").Range("E4").Value = I&lt;br&gt;Worksheets("sheet1").Range("E5").Value = h&lt;br&gt;Worksheets("sheet1").Range("E6").Value = y&lt;br&gt;Worksheets("sheet1").Range("E7").Value = k&lt;br&gt;Worksheets("sheet1").Range("E8").Value = Counter&lt;br&gt;&lt;br&gt;End Sub&lt;br&gt;</description><pubDate>Thu, 19 Feb 2009 12:26:27 GMT</pubDate><dc:creator>tjruler</dc:creator></item><item><title>VB Code in Excel--formating with condition</title><link>http://www.a1vbcode.com/vbforums/Topic27021-14-1.aspx</link><description>i am be importing the data file from Web site . which are in a single column.&lt;br&gt;&lt;br&gt;To make clear&lt;br&gt;&lt;br&gt;2009,2,13,1,1,72.32&lt;br&gt;1) I need to place  the data's in different column&lt;br&gt;&lt;br&gt;2) here ......&lt;br&gt;First - year&lt;br&gt;Second - month&lt;br&gt;Third -  date&lt;br&gt;Fourth - first hour of the day&lt;br&gt;Fifth - first five mins of the hour&lt;br&gt;Sixth - an integer   value&lt;br&gt;&lt;br&gt;3) Change the fifth column into actual mins&lt;br&gt;&lt;br&gt;4) Fourth and Fifth column should look like....01:05 in a single column..&lt;br&gt;&lt;br&gt;5) And every time the data refreshes ...it would come in the above format with the No:3 and No:4 condition.&lt;br&gt;&lt;br&gt;example&lt;br&gt;&lt;br&gt;2009,2,13,1,1,72.32&lt;br&gt;2009,2,13,1,2,75.45&lt;br&gt;would look like &lt;br&gt;&lt;br&gt;2009| 2| 13| 1:05| 72.32| &lt;br&gt;2009| 2| 13| 1:10| 75.45|&lt;br&gt;&lt;br&gt;&lt;br&gt;Thanks .. &lt;br&gt;&lt;br&gt;krofox&lt;br&gt;</description><pubDate>Sun, 15 Feb 2009 12:08:11 GMT</pubDate><dc:creator>krofox</dc:creator></item><item><title>VBA Excel Convert the excel file into readonly by codes...</title><link>http://www.a1vbcode.com/vbforums/Topic26903-14-1.aspx</link><description>Hello...... I am working on SQL Server 2000. I have a database that has almost 150 tables. I need to develop a report in excel. For this purpose i need to fetch data from my database and display the same in excel. &lt;br&gt;&lt;br&gt;After doing this i need to ensure that no one can edit the data that i have fetched. So somehow i need to lock the grid of the excel sheet in which i have displayed the report result. Cant do this........What to do?</description><pubDate>Thu, 29 Jan 2009 14:28:09 GMT</pubDate><dc:creator>Krishal Rajput</dc:creator></item><item><title>How to insert a set of particular rows ABOVE an active cell in MS-EXCEL ?</title><link>http://www.a1vbcode.com/vbforums/Topic26906-14-1.aspx</link><description>Using the macro which inserts rows below the active cell..we will not be able to insert rows above the TOP MOST row...So it would be much helpful  if we can insert rows above an active cell. Please let me know the macro by which we can insert rows above an active cell.&lt;br&gt;&lt;br&gt;Thanks in advance!!!&lt;img align="absmiddle" src="http://www.a1vbcode.com/vbforums/Skins/Classic/Images/EmotIcons/Smile.gif" border="0" title="Smile"&gt;&lt;br&gt;&lt;br&gt;Vamshi Bandi.</description><pubDate>Fri, 30 Jan 2009 00:29:03 GMT</pubDate><dc:creator>vamshi.bandi</dc:creator></item><item><title>Word, VB.NET, section breaks</title><link>http://www.a1vbcode.com/vbforums/Topic25557-14-1.aspx</link><description>I need to add a section break to a Word document to change from one column to two columns. The only break I find is a page break like&lt;br&gt;&lt;br&gt;         oWord.Selection.InsertBreak()&lt;br&gt;&lt;br&gt;When I add the columns like this&lt;br&gt;&lt;br&gt;            oWord.Selection.PageSetup.TextColumns.SetCount(NumColumns:=2)&lt;br&gt;&lt;br&gt;it changes the whole document to two columns, something I do not want. I understand that I need to add section break but how?  Thanks for the help.</description><pubDate>Sat, 09 Aug 2008 12:16:09 GMT</pubDate><dc:creator>Johan Marais</dc:creator></item><item><title>Sending a Mail merge from Mutilpe Email Accounts</title><link>http://www.a1vbcode.com/vbforums/Topic26086-14-1.aspx</link><description>Hey All&lt;/P&gt;&lt;P&gt;I have a dilema. I currently have Outlook 2003 which has mutiple mailboxes. I have created a Macro in Word 2003 that sends out emails after i run a mail merge. Problem is I have multiple mailboxes and each mail merge needs to be sent from a different email account depending on a field in the mail merge.&lt;/P&gt;&lt;P&gt;Anyone have any idea how I how to send an email from a certain address.&lt;/P&gt;&lt;P&gt;EG: Merge field 'a' needs to be sent from email adress &lt;A href="mailto:a@a.com"&gt;a@a.com&lt;/A&gt; and if merge field has 'b' in it then it needs to be sent from &lt;A href="mailto:b@b.com"&gt;b@b.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;How do I get it to to send from these mailboxes as if it was from these fields and not "on behalf of"&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;KaosTheory</description><pubDate>Mon, 27 Oct 2008 22:41:52 GMT</pubDate><dc:creator>KaosTheory</dc:creator></item><item><title>Excel Addin Automation</title><link>http://www.a1vbcode.com/vbforums/Topic26544-14-1.aspx</link><description>Hi Friends&lt;br&gt;&lt;br&gt;Developing a addin for office using vb6. Already done with word and outlook but sort off stuck in Excel addin..&lt;img align="absmiddle" src="http://www.a1vbcode.com/vbforums/Skins/Classic/Images/EmotIcons/Sick.gif" border="0" title="Sick"&gt;&lt;br&gt;&lt;br&gt;Problem is that i can't get the name of the file that i want to print..have tried getopenfilename and stuff but doesn't seem to work out..?&lt;br&gt;&lt;br&gt;Hoping for some help from you guys..&lt;br&gt;&lt;br&gt;Can definitely post some code if needed..&lt;img align="absmiddle" src="http://www.a1vbcode.com/vbforums/Skins/Classic/Images/EmotIcons/BigGrin.gif" border="0" title="BigGrin"&gt;</description><pubDate>Thu, 25 Dec 2008 00:36:41 GMT</pubDate><dc:creator>Bradd</dc:creator></item><item><title>Creating a movable line</title><link>http://www.a1vbcode.com/vbforums/Topic25994-14-1.aspx</link><description>Hi,&lt;br&gt;&lt;br&gt;I have to create a movable vertical line in a chart which consists of 3 graphs. the line should be movable from left to right and vice versa with regard to the x-axis. &lt;br&gt;&lt;br&gt;Example: Let's say that the line is dragged on a particular value on the x-axis, the values of the y axis should be shown on each point of the graph. &lt;br&gt;&lt;br&gt;How do i create such a movable line?&lt;br&gt;&lt;br&gt;I hope you got me..</description><pubDate>Mon, 13 Oct 2008 09:16:45 GMT</pubDate><dc:creator>Wildrose</dc:creator></item><item><title>Using Application.Run to launch a macro in another workbook but processing halts when a msgbox comes up in that macro.  How to continue processing automatically?</title><link>http://www.a1vbcode.com/vbforums/Topic26274-14-1.aspx</link><description>Here is a better explaination of the challenge I need help with.  How do I get past the MsgBox "This is Book2" in an automated way?&lt;P&gt;In Workbook1:&lt;BR&gt;Sub B1M1()&lt;BR&gt;Application.Run "'" &amp;amp; "Book2.xls'!B2M1"&lt;BR&gt;MsgBox "This is Book1, returned from Bk2"&lt;BR&gt;End Sub&lt;P&gt;In Workbook2:&lt;BR&gt;Sub B2M1()&lt;BR&gt;MsgBox "This is Book2"&lt;BR&gt;End Sub&lt;P&gt;From earlier post (FYI):&lt;P&gt;Just guessing but am looking at the RUN Method documentation (F1 in VB editor) and it shows how you can pass two variables, should I pass a SendKey to answer the MsgBox?   Last last night I reported that processing was not passing back to the host workbook but I just tested this again and it is passing back. </description><pubDate>Wed, 19 Nov 2008 00:46:55 GMT</pubDate><dc:creator>Catman</dc:creator></item><item><title>How to interupt a progress bar</title><link>http://www.a1vbcode.com/vbforums/Topic26216-14-1.aspx</link><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Arial&gt;&lt;FONT size=3&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #1f5080; FONT-FAMILY: Verdana"&gt;&lt;FONT color=#111111&gt;I have a splash screen that appears when Excel is opened.  Normally it disappears after a few seconds and a progress bar shows time remaining.   I want to be able to stop the splash screen from disappearing so I added a command button to the splashscreen (form) labeled "pause", if  clicked I should temporarily stop the progress bar and allow the splashscreen to remain in view.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #1f5080; FONT-FAMILY: Verdana"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;FONT color=#111111&gt;  &lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #1f5080; FONT-FAMILY: Verdana"&gt;&lt;FONT color=#111111&gt;Here’s what I have so far:&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #1f5080; FONT-FAMILY: Verdana"&gt;&lt;o:p&gt;&lt;FONT face=Arial color=#111111 size=3&gt; &lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #1f5080; FONT-FAMILY: Verdana"&gt;&lt;FONT color=#111111&gt;&lt;FONT face=Arial&gt;&lt;FONT size=3&gt;1.&lt;SPAN style="mso-spacerun: yes"&gt;  &lt;/SPAN&gt;An Open event (for Workbook) brings the splashscreen into view:&lt;SPAN style="mso-spacerun: yes"&gt;   &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #1f5080; FONT-FAMILY: Verdana"&gt;&lt;FONT color=#111111&gt;&lt;FONT face=Arial&gt;&lt;FONT size=3&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #1f5080; FONT-FAMILY: Verdana"&gt;&lt;FONT color=#111111&gt;&lt;FONT face=Arial&gt;&lt;FONT size=3&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;/SPAN&gt;Private Sub Workbook_Open()&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #1f5080; FONT-FAMILY: Verdana"&gt;&lt;FONT color=#111111&gt;&lt;FONT face=Arial&gt;&lt;FONT size=3&gt;SplashScreen.Show&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #1f5080; FONT-FAMILY: Verdana"&gt;&lt;FONT color=#111111&gt;&lt;FONT face=Arial&gt;&lt;FONT size=3&gt;End Sub&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Arial color=#000000 size=3&gt; &lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Arial color=#000000 size=3&gt;2.&lt;SPAN style="mso-spacerun: yes"&gt;  &lt;/SPAN&gt;The form code (for splash screen) does this: &lt;/FONT&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Arial color=#000000 size=3&gt; &lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT color=#000000&gt;&lt;FONT face=Arial&gt;&lt;FONT size=3&gt;Private Sub UserForm_Activate()&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT color=#000000&gt;&lt;FONT face=Arial&gt;&lt;FONT size=3&gt;Dim dTime As Date&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT color=#000000&gt;&lt;FONT face=Arial&gt;&lt;FONT size=3&gt;Dim i As Integer&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT color=#000000&gt;&lt;FONT face=Arial&gt;&lt;FONT size=3&gt;For i = 1 To 100 Step 15&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT color=#000000&gt;&lt;FONT face=Arial&gt;&lt;FONT size=3&gt;dTime = Now + TimeValue("0:00:01")&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT color=#000000&gt;&lt;FONT face=Arial&gt;&lt;FONT size=3&gt;Application.Wait TimeValue(dTime)&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT color=#000000&gt;&lt;FONT face=Arial&gt;&lt;FONT size=3&gt;ProgressBar1.Value = i&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT color=#000000&gt;&lt;FONT face=Arial&gt;&lt;FONT size=3&gt;Next i&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT color=#000000&gt;&lt;FONT face=Arial&gt;&lt;FONT size=3&gt;Call EndSplash&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Arial color=#000000 size=3&gt;End Sub&lt;/FONT&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Arial color=#000000 size=3&gt; &lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Arial color=#000000 size=3&gt;3.&lt;SPAN style="mso-spacerun: yes"&gt;  The For i loop delays the call of EndSplash for ~5 seconds.  While the loop is executing I think I need to check the state of a command button to see if the user has clicked it (or not), just not sure how to do this.  Well that's my though, maybe I am in left field and there is a better method, the main point is, how to temporarily stop the slash screen from dissapearing automatically.   Appreciate any help and thanks in advance.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Arial color=#000000 size=3&gt;&lt;/FONT&gt;&lt;/o:p&gt; &lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Arial color=#000000 size=3&gt; &lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt; </description><pubDate>Wed, 12 Nov 2008 23:24:08 GMT</pubDate><dc:creator>Catman</dc:creator></item><item><title>Aligning Text  in a String for use in an EMail</title><link>http://www.a1vbcode.com/vbforums/Topic26109-14-1.aspx</link><description>I have a system designed arounf Outlook 2007 using VB6.&lt;BR&gt;The system generates Email Confirmations to the clients which involve listing the products that they have purchased, e.g.&lt;/P&gt;&lt;P&gt;Description   Qty  Price Order Discounts                          Order Total&lt;BR&gt;Product 1        1         12.39 No discounts on this item             12.39&lt;BR&gt;Product 2        1           9.27 10% Discount Applied                   9.27&lt;/P&gt;&lt;P&gt;etc etc etc.&lt;BR&gt;This string is built up from a dataset using a combination of padded strings, e.g. &lt;/P&gt;&lt;P&gt;ProdDesc = Format(DatasetValue, "!@@@@@@@@@@@@@@@@@@@")&lt;BR&gt;ProdPrice = Format(DatasetValue, "@@@@@@@")&lt;BR&gt;etc etc&lt;BR&gt;Email string = ProdDesc &amp;amp; ProdPrice ..... &amp;amp; vbcr&lt;/P&gt;&lt;P&gt;I end up with a string which does not line up.&lt;/P&gt;&lt;P&gt;I have also tried using fixed strings with vbtab but this also doe not always line up.&lt;/P&gt;&lt;P&gt;Anyone got any other ideas?</description><pubDate>Mon, 03 Nov 2008 09:39:13 GMT</pubDate><dc:creator>BenjiB</dc:creator></item><item><title>How to insert a set of particular rows under the active cell</title><link>http://www.a1vbcode.com/vbforums/Topic25881-14-1.aspx</link><description>I'm a complete VBA newbie. I've got a worksheet where I want to allow the user to insert rows 101:106 above the active cell that the user selects. Using the below code, the macro pastes the rows below row 106, and not at the row the user selects....&lt;/P&gt;&lt;P&gt;What's the best way to fix this?&lt;/P&gt;&lt;P&gt;Sub InsertRowPlanning()&lt;BR&gt;'&lt;BR&gt;' InsertRowPlanning Macro&lt;BR&gt;'&lt;BR&gt;    ActiveSheet.Unprotect Password:=PWORD&lt;BR&gt;    Rows("101:106").Select&lt;BR&gt;    Selection.Copy&lt;BR&gt;    ActiveCell.Select&lt;BR&gt;    Selection.Insert Shift:=xlDown&lt;BR&gt;    ActiveCell.EntireRow.Select&lt;BR&gt;    Application.CutCopyMode = False&lt;BR&gt;    ActiveSheet.Protect Password:=PWORD&lt;BR&gt;End Sub&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;Sunil</description><pubDate>Sun, 05 Oct 2008 10:56:34 GMT</pubDate><dc:creator>sunilmulay</dc:creator></item></channel></rss>