<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2398001692718253408</id><updated>2015-03-03T11:15:01.075-08:00</updated><title type='text'>Access</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://rmlpanelaccess.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2398001692718253408/posts/default'/><link rel='alternate' type='text/html' href='http://rmlpanelaccess.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>RML Panel</name><uri>http://www.blogger.com/profile/07925140693385949898</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>14</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2398001692718253408.post-5114823605427425723</id><published>2015-03-03T11:15:00.000-08:00</published><updated>2015-03-03T11:15:01.088-08:00</updated><title type='text'>VBA modify Multivalued Field</title><content type='html'>Private Sub Criteria_Tracker_ID_Exit(Cancel As Integer)&lt;br /&gt;&lt;br /&gt;Dim db As Database&lt;br /&gt;Dim rs1 As Recordset&lt;br /&gt;Dim rs2 As Recordset&lt;br /&gt;Dim childRS As Recordset&lt;br /&gt;Dim var As Variant&lt;br /&gt;Dim CriteriaName As String&lt;br /&gt;Dim strRange1 As String&lt;br /&gt;Dim strRange2 As String&lt;br /&gt;&lt;br /&gt;CriteriaName = &quot;&quot;&lt;br /&gt;&lt;br /&gt;Set db = CurrentDb&lt;br /&gt;Set rst1 = db.OpenRecordset(&quot;SF Data and Technology Priorities&quot;)&lt;br /&gt;strRange1 = &quot;SELECT [Criteria Tracker ID] FROM [SF Data and Technology Priorities] WHERE [ID] = &quot; &amp;amp; Me.[ID].Value&lt;br /&gt;&#39; &quot;Me&quot; identify current selected record on the form.&lt;br /&gt;Set rs1 = db.OpenRecordset(strRange1)&lt;br /&gt;&lt;br /&gt;&#39; Multivalued field is actually a recordset. Here &quot;Criteria Tracker ID&quot; is multivalued field&lt;br /&gt;Set childRS = rs1![Criteria Tracker ID].Value&lt;br /&gt;&lt;br /&gt;If childRS.RecordCount = 0 Then&lt;br /&gt;&amp;nbsp; &amp;nbsp; Me.[Criteria Name].Value = &quot;&quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; Me.[Criteria Name].SetFocus&lt;br /&gt;&amp;nbsp; &amp;nbsp; Exit Sub&lt;br /&gt;End If&lt;br /&gt;&lt;br /&gt;childRS.MoveFirst&lt;br /&gt;&lt;br /&gt;&#39; Loop through the records in the child recordset.&lt;br /&gt;Do Until childRS.EOF&lt;br /&gt;&amp;nbsp; &amp;nbsp;strRange2 = &quot;SELECT [Sector] FROM [SF Criteria Tracker] WHERE [ID] = &quot; &amp;amp; childRS.Fields(0).Value&lt;br /&gt;&amp;nbsp; &amp;nbsp;Set rs2 = db.OpenRecordset(strRange2)&lt;br /&gt;&amp;nbsp; &amp;nbsp;CriteriaName = CriteriaName &amp;amp; rs2![Sector].Value &amp;amp; &quot;; &quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp;rs2.Close&lt;br /&gt;&amp;nbsp; &amp;nbsp;childRS.MoveNext&lt;br /&gt;Loop&lt;br /&gt;&lt;br /&gt;rs1.Close&lt;br /&gt;Me.[Criteria Name].Value = CriteriaName&lt;br /&gt;Me.[Criteria Name].SetFocus&lt;br /&gt;&#39; [Criteria Name] can be written as Criteria_Name, we can use _ to replace space in the field name&lt;br /&gt;End Sub</content><link rel='replies' type='application/atom+xml' href='http://rmlpanelaccess.blogspot.com/feeds/5114823605427425723/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rmlpanelaccess.blogspot.com/2015/03/vba-modify-multivalued-field.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2398001692718253408/posts/default/5114823605427425723'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2398001692718253408/posts/default/5114823605427425723'/><link rel='alternate' type='text/html' href='http://rmlpanelaccess.blogspot.com/2015/03/vba-modify-multivalued-field.html' title='VBA modify Multivalued Field'/><author><name>RML Panel</name><uri>http://www.blogger.com/profile/07925140693385949898</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2398001692718253408.post-492889802171225378</id><published>2015-01-09T14:00:00.001-08:00</published><updated>2015-01-09T14:00:17.870-08:00</updated><title type='text'>Form VBA Sort or Order by 2 or more fields</title><content type='html'>Me.OrderBy = Me.cboSort1 &amp;amp; &quot; DESC, &quot; &amp;amp; Me.cboSort2 &amp;amp; &quot; ASC&quot;&lt;br /&gt;Me.OrderByOn = True</content><link rel='replies' type='application/atom+xml' href='http://rmlpanelaccess.blogspot.com/feeds/492889802171225378/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rmlpanelaccess.blogspot.com/2015/01/form-vba-sort-or-order-by-2-or-more.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2398001692718253408/posts/default/492889802171225378'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2398001692718253408/posts/default/492889802171225378'/><link rel='alternate' type='text/html' href='http://rmlpanelaccess.blogspot.com/2015/01/form-vba-sort-or-order-by-2-or-more.html' title='Form VBA Sort or Order by 2 or more fields'/><author><name>RML Panel</name><uri>http://www.blogger.com/profile/07925140693385949898</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2398001692718253408.post-4816427512001944358</id><published>2015-01-06T11:19:00.001-08:00</published><updated>2015-01-06T11:19:35.494-08:00</updated><title type='text'>Add VBA code to a control (button, combobox etc.) on from</title><content type='html'>1. Go to design or layout view of the form&lt;br /&gt;2. Right click the Control and select &quot;Properties&quot; ==&amp;gt; &quot;Event&quot; tab&lt;br /&gt;3. Go to &quot;On click&quot;, select &quot;...&quot;, on popup box select &quot;Code Builder&quot; (Alternatively, select &quot;[Event Procedure]&quot;, then click &quot;...&quot;)&lt;br /&gt;4.Change Control name if necessary by going to &quot;Other&quot; tab ==&amp;gt; &quot;Name&quot;</content><link rel='replies' type='application/atom+xml' href='http://rmlpanelaccess.blogspot.com/feeds/4816427512001944358/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rmlpanelaccess.blogspot.com/2015/01/add-vba-code-to-control-button-combobox.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2398001692718253408/posts/default/4816427512001944358'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2398001692718253408/posts/default/4816427512001944358'/><link rel='alternate' type='text/html' href='http://rmlpanelaccess.blogspot.com/2015/01/add-vba-code-to-control-button-combobox.html' title='Add VBA code to a control (button, combobox etc.) on from'/><author><name>RML Panel</name><uri>http://www.blogger.com/profile/07925140693385949898</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2398001692718253408.post-4168432025385553351</id><published>2015-01-06T11:13:00.002-08:00</published><updated>2015-01-06T11:13:58.145-08:00</updated><title type='text'>Click a button on a form to export a table</title><content type='html'>1. Go to design or layout view of the form&lt;br /&gt;2. Right click the command button and select &quot;Properties&quot; ==&amp;gt; &quot;Event&quot; tab&lt;br /&gt;3. Go to &quot;On click&quot;, select &quot;...&quot;, on popup box select &quot;Macro Builder&quot;&lt;br /&gt;4. Under &quot;Action Catalog&quot; on the right (click &quot;Action Catalog&quot; under &quot;Design&quot; tab on the top if it is shown&quot;, select &quot;Data Import/Export&quot;==&amp;gt; &quot;ExportWithFormatting&quot;</content><link rel='replies' type='application/atom+xml' href='http://rmlpanelaccess.blogspot.com/feeds/4168432025385553351/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rmlpanelaccess.blogspot.com/2015/01/click-button-on-form-to-export-table.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2398001692718253408/posts/default/4168432025385553351'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2398001692718253408/posts/default/4168432025385553351'/><link rel='alternate' type='text/html' href='http://rmlpanelaccess.blogspot.com/2015/01/click-button-on-form-to-export-table.html' title='Click a button on a form to export a table'/><author><name>RML Panel</name><uri>http://www.blogger.com/profile/07925140693385949898</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2398001692718253408.post-8652639061419297669</id><published>2015-01-06T10:53:00.003-08:00</published><updated>2015-01-06T11:06:16.290-08:00</updated><title type='text'>Create Dropdown list in Form (only one value can be selected)</title><content type='html'>1. Go to Design or Layout view of the form&lt;br /&gt;2. Right click the field, select &quot;Properties&quot;&lt;br /&gt;3. Go to &quot;Data&quot; tab&lt;br /&gt;4. Change &quot;Row Source&quot; Type to &quot;Value List&quot;&lt;br /&gt;5. Enter list of choices under &quot;Row Source&quot;, e.g. &quot;Yes&quot;;&quot;No&quot;, or click &quot;...&quot; to enter &lt;br /&gt;&lt;br /&gt;You may want to add below for data validation to prevent accidentally direct data inputs to the linked table (not necessary) &lt;br /&gt;1. Go to the Design view of the table linked to the form. &lt;br /&gt;2. Select Field ==&amp;gt; go to &quot;General&quot; tab at the bottom.&lt;br /&gt;3. Go to &quot;Validation Rule&quot; and enter list of choices, e.g. &quot;Yes&quot;;&quot;No&quot;&lt;br /&gt; </content><link rel='replies' type='application/atom+xml' href='http://rmlpanelaccess.blogspot.com/feeds/8652639061419297669/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rmlpanelaccess.blogspot.com/2015/01/create-dropdown-list-in-form.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2398001692718253408/posts/default/8652639061419297669'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2398001692718253408/posts/default/8652639061419297669'/><link rel='alternate' type='text/html' href='http://rmlpanelaccess.blogspot.com/2015/01/create-dropdown-list-in-form.html' title='Create Dropdown list in Form (only one value can be selected)'/><author><name>RML Panel</name><uri>http://www.blogger.com/profile/07925140693385949898</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2398001692718253408.post-2357092051103101802</id><published>2015-01-06T10:53:00.000-08:00</published><updated>2015-01-06T10:56:45.827-08:00</updated><title type='text'>Create dropdown list with multiple selection check boxes in form</title><content type='html'>1. Go to the Design view of the table linked to the form. &lt;br /&gt;2. Select Field ==&amp;gt; go to &quot;Lookup&quot; tab at the bottom.&lt;br /&gt;3. Change &quot;Row source Type&quot; to &quot;Value List&quot; &lt;br /&gt;4. Go to &quot;Row Source&quot; and enter list of choices,&lt;br /&gt;&amp;nbsp;&amp;nbsp; e.g. &quot;ABCP&quot;;&quot;ABS&quot;;&quot;All Asset Classes&quot;;&quot;CB&quot;;&quot;CMBS&quot;;&quot;RMBS&quot;;&quot;SME&quot;;&quot;SC&quot;;&quot;LOC&quot;&lt;br /&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://rmlpanelaccess.blogspot.com/feeds/2357092051103101802/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rmlpanelaccess.blogspot.com/2015/01/create-multiple-selection-check-boxes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2398001692718253408/posts/default/2357092051103101802'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2398001692718253408/posts/default/2357092051103101802'/><link rel='alternate' type='text/html' href='http://rmlpanelaccess.blogspot.com/2015/01/create-multiple-selection-check-boxes.html' title='Create dropdown list with multiple selection check boxes in form'/><author><name>RML Panel</name><uri>http://www.blogger.com/profile/07925140693385949898</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2398001692718253408.post-99067418372995915</id><published>2015-01-06T10:45:00.000-08:00</published><updated>2015-01-06T10:45:37.239-08:00</updated><title type='text'>Apply Conditonal Formatting to Form</title><content type='html'>Go to Design or Layout View, click on the column/field,&amp;nbsp; a &quot;Form Design Tool&quot; section appears on the top menu bar, go to format ==&amp;gt; Conditional Formatting&lt;br /&gt;&lt;br /&gt;example rules: ([Status]=&quot;Backlog&quot; Or [Status]=&quot;Completed&quot;) And [Active]=&quot;Yes&quot;</content><link rel='replies' type='application/atom+xml' href='http://rmlpanelaccess.blogspot.com/feeds/99067418372995915/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rmlpanelaccess.blogspot.com/2015/01/apply-conditonal-formatting-to-form.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2398001692718253408/posts/default/99067418372995915'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2398001692718253408/posts/default/99067418372995915'/><link rel='alternate' type='text/html' href='http://rmlpanelaccess.blogspot.com/2015/01/apply-conditonal-formatting-to-form.html' title='Apply Conditonal Formatting to Form'/><author><name>RML Panel</name><uri>http://www.blogger.com/profile/07925140693385949898</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2398001692718253408.post-1142639137435701749</id><published>2015-01-06T10:36:00.003-08:00</published><updated>2015-01-06T10:36:16.919-08:00</updated><title type='text'>VBA apply multiple filters</title><content type='html'>Private Sub cmdGenerate_Click()&lt;br /&gt;Dim PriorityFilter As String&lt;br /&gt;Dim AssetClassFilter As String&lt;br /&gt;Dim ImpactedRegionFilter As String&lt;br /&gt;Dim ImpactTypeFilter As String&lt;br /&gt;Dim StatusFilter As String&lt;br /&gt;Dim TotalFilter As String&lt;br /&gt;&lt;br /&gt;If Me.cboPriority &amp;lt;&amp;gt; &quot;All&quot; Then&lt;br /&gt;TotalFilter = &quot;[Priority] = &#39;&quot; &amp;amp; Me.cboPriority &amp;amp; &quot;&#39;&quot;&lt;br /&gt;Else&lt;br /&gt;TotalFilter = &quot;([Priority] Is Null Or [Priority] Like &#39;*&#39;)&quot;&lt;br /&gt;End If&lt;br /&gt;&lt;br /&gt;If Me.cboAssetClass &amp;lt;&amp;gt; &quot;All&quot; Then&lt;br /&gt;TotalFilter  = TotalFilter &amp;amp; &quot; And ([Asset Class] = &#39;All Asset Classes&#39; Or  [Asset Class] Like &#39;*&quot; &amp;amp; Me.cboAssetClass &amp;amp; &quot;*&#39;)&quot;&lt;br /&gt;Else&lt;br /&gt;TotalFilter = TotalFilter &amp;amp; &quot; And ([Asset Class] Is Null Or [Asset Class] Like &#39;*&#39;)&quot;&lt;br /&gt;End If&lt;br /&gt;&lt;br /&gt;If Me.cboImpactedRegion &amp;lt;&amp;gt; &quot;All&quot; Then&lt;br /&gt;TotalFilter  = TotalFilter &amp;amp; &quot; And ([Impacted Region] = &#39;All Regions&#39; Or  [Impacted Region] Like &#39;*&quot; &amp;amp; Me.cboImpactedRegion &amp;amp; &quot;*&#39;)&quot;&lt;br /&gt;Else&lt;br /&gt;TotalFilter = TotalFilter &amp;amp; &quot; And ([Impacted Region] Is Null Or [Impacted Region] Like &#39;*&#39;)&quot;&lt;br /&gt;End If&lt;br /&gt;&lt;br /&gt;If Me.cboImpactType &amp;lt;&amp;gt; &quot;All&quot; Then&lt;br /&gt;TotalFilter = TotalFilter &amp;amp; &quot; And [Impact Type] = &#39;&quot; &amp;amp; Me.cboImpactType &amp;amp; &quot;&#39;&quot;&lt;br /&gt;Else&lt;br /&gt;TotalFilter = TotalFilter &amp;amp; &quot; And ([Impact Type] Is Null Or [Impact Type] Like &#39;*&#39;)&quot;&lt;br /&gt;End If&lt;br /&gt;&lt;br /&gt;If Me.cboStatus &amp;lt;&amp;gt; &quot;All&quot; Then&lt;br /&gt;TotalFilter = TotalFilter &amp;amp; &quot; And [Status] = &#39;&quot; &amp;amp; Me.cboStatus &amp;amp; &quot;&#39;&quot;&lt;br /&gt;Else&lt;br /&gt;TotalFilter = TotalFilter &amp;amp; &quot; And ([Status] Is Null Or [Status] Like &#39;*&#39;)&quot;&lt;br /&gt;End If&lt;br /&gt;&lt;br /&gt;DoCmd.ApplyFilter , TotalFilter&lt;br /&gt;&lt;br /&gt;Forms![SF Data and Technology Priorities].OrderBy = Me.cboSort&lt;br /&gt;Forms![SF Data and Technology Priorities].OrderByOn = True&lt;br /&gt;&lt;br /&gt;End Sub</content><link rel='replies' type='application/atom+xml' href='http://rmlpanelaccess.blogspot.com/feeds/1142639137435701749/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rmlpanelaccess.blogspot.com/2015/01/vba-apply-multiple-filters.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2398001692718253408/posts/default/1142639137435701749'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2398001692718253408/posts/default/1142639137435701749'/><link rel='alternate' type='text/html' href='http://rmlpanelaccess.blogspot.com/2015/01/vba-apply-multiple-filters.html' title='VBA apply multiple filters'/><author><name>RML Panel</name><uri>http://www.blogger.com/profile/07925140693385949898</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2398001692718253408.post-3959732909651253780</id><published>2012-12-10T13:49:00.003-08:00</published><updated>2012-12-10T13:49:51.428-08:00</updated><title type='text'>Delete dataset from database using VBA</title><content type='html'>&lt;br /&gt;&amp;nbsp;Dim cnn As New ADODB.Connection&lt;br /&gt;&amp;nbsp;Dim rst As New ADODB.Recordset&lt;br /&gt;&amp;nbsp;Dim DatasetID As Integer&lt;br /&gt;&amp;nbsp;cnn.Open &quot;Provider=Microsoft.ACE.OLEDB.12.0;&quot; &amp;amp; _&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot;Data Source=C:\CovBonds\CB.mdb&quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; Dim strRange As String&lt;br /&gt;&amp;nbsp;strRange = &quot;SELECT * FROM dbo_tblCoveredBonds Where [cboExistingCoveredBondProgram] = &#39;&quot; &amp;amp; cboExistingCoveredBondProgram &amp;amp; &quot;&#39; AND [cboCoveredBondType] = &#39;&quot; &amp;amp; cboCoveredBondType &amp;amp; &quot;&#39; AND [cboCoveredBondSubType] = &#39;&quot; &amp;amp; cboCoveredBondSubType &amp;amp; &quot;&#39; AND [cboReportingDate] = #&quot; &amp;amp; VBA.Format(cboReportingDate, &quot;mm/dd/yyyy&quot;) &amp;amp; &quot;#;&quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rst.Open strRange, _&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cnn, adOpenDynamic, adLockOptimistic&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If rst.RecordCount &amp;lt;&amp;gt; 0 Then&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DatasetID = rst![ProgramID].Value&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rst.Delete&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Else&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MsgBox &quot;This dataset is not in database.&quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Exit Sub&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End If&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Set rst = Nothing</content><link rel='replies' type='application/atom+xml' href='http://rmlpanelaccess.blogspot.com/feeds/3959732909651253780/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rmlpanelaccess.blogspot.com/2012/12/delete-dataset-from-database-using-vba.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2398001692718253408/posts/default/3959732909651253780'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2398001692718253408/posts/default/3959732909651253780'/><link rel='alternate' type='text/html' href='http://rmlpanelaccess.blogspot.com/2012/12/delete-dataset-from-database-using-vba.html' title='Delete dataset from database using VBA'/><author><name>RML Panel</name><uri>http://www.blogger.com/profile/07925140693385949898</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2398001692718253408.post-4476131442538423642</id><published>2012-09-20T10:55:00.003-07:00</published><updated>2012-09-20T10:55:55.530-07:00</updated><title type='text'>VBA Select MAX dataset from database</title><content type='html'>&lt;br /&gt;Sub test()&lt;br /&gt;&amp;nbsp; &amp;nbsp; Dim cnn As New ADODB.Connection&lt;br /&gt;&amp;nbsp; &amp;nbsp; Dim rst As New ADODB.Recordset&lt;br /&gt;&amp;nbsp; &amp;nbsp; Dim oCm As New ADODB.Command&lt;br /&gt;&amp;nbsp; &amp;nbsp; cnn.Open &quot;Provider=Microsoft.ACE.OLEDB.12.0;&quot; &amp;amp; _&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot;Data Source=C:\CovBonds\CB.mdb&quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; Dim strRange As String&lt;br /&gt;&amp;nbsp; &amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; strRange = &quot;SELECT MAX([ProgramID]) FROM dbo_tblCoveredBonds;&quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; rst.Open strRange, _&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cnn, adOpenStatic&lt;br /&gt;&amp;nbsp; &amp;nbsp; rst.MoveFirst&lt;br /&gt;&amp;nbsp; &amp;nbsp; Sheets(&quot;Misc&quot;).Range(&quot;R2&quot;).Value = rst.RecordCount&lt;br /&gt;&amp;nbsp; &amp;nbsp; Sheets(&quot;Misc&quot;).Range(&quot;Q2&quot;).Value = rst.Fields(0).Value&lt;br /&gt;&amp;nbsp; &lt;br /&gt;End Sub&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rmlpanelaccess.blogspot.com/feeds/4476131442538423642/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rmlpanelaccess.blogspot.com/2012/09/vba-select-max-dataset-from-database.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2398001692718253408/posts/default/4476131442538423642'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2398001692718253408/posts/default/4476131442538423642'/><link rel='alternate' type='text/html' href='http://rmlpanelaccess.blogspot.com/2012/09/vba-select-max-dataset-from-database.html' title='VBA Select MAX dataset from database'/><author><name>RML Panel</name><uri>http://www.blogger.com/profile/07925140693385949898</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2398001692718253408.post-7011607964678986825</id><published>2012-07-31T13:39:00.003-07:00</published><updated>2012-07-31T13:41:46.166-07:00</updated><title type='text'>Delete All Tables or One Table</title><content type='html'>&lt;br /&gt;Sub DeleteFromAllTables()&lt;br /&gt;On Error GoTo Err_DeleteFromAllTables&lt;br /&gt;Dim dbCurr As DAO.Database&lt;br /&gt;Dim tdfCurr As DAO.TableDef&lt;br /&gt;&lt;br /&gt;Set dbCurr = CurrentDb()&lt;br /&gt;For Each tdfCurr In dbCurr.TableDefs&lt;br /&gt;If (tdfCurr.Attributes And dbSystemObject) = 0 Then&lt;br /&gt;dbCurr.Execute &quot;DELETE * FROM [&quot; &amp;amp; tdfCurr.Name &amp;amp; &quot;]&quot;, dbFailOnError&lt;br /&gt;End If&lt;br /&gt;Next tdfCurr&lt;br /&gt;&lt;br /&gt;End_DeleteFromAllTables:&lt;br /&gt;Set dbCurr = Nothing&lt;br /&gt;Exit Sub&lt;br /&gt;&lt;br /&gt;Err_DeleteFromAllTables:&lt;br /&gt;MsgBox Err.Number &amp;amp; &quot;: &quot; &amp;amp; Err.Description&lt;br /&gt;Resume End_DeleteFromAllTables&lt;br /&gt;&lt;br /&gt;End Sub&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&#39;delete one table data code: DoCmd.RunSQL &quot;DELETE Table1.* FROM Table1;&quot;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rmlpanelaccess.blogspot.com/feeds/7011607964678986825/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rmlpanelaccess.blogspot.com/2012/07/delete-all-table.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2398001692718253408/posts/default/7011607964678986825'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2398001692718253408/posts/default/7011607964678986825'/><link rel='alternate' type='text/html' href='http://rmlpanelaccess.blogspot.com/2012/07/delete-all-table.html' title='Delete All Tables or One Table'/><author><name>RML Panel</name><uri>http://www.blogger.com/profile/07925140693385949898</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2398001692718253408.post-7909531894944989761</id><published>2012-07-31T13:37:00.002-07:00</published><updated>2012-07-31T13:37:31.495-07:00</updated><title type='text'>Open Excel File within the Same Folder</title><content type='html'>&lt;br /&gt;Dim objXL As Object&lt;br /&gt;Dim objXLWB As Object&lt;br /&gt;&lt;br /&gt;Dim MyBook As String&lt;br /&gt;MyBook = CurrentProject.Path &amp;amp; &quot;\YouExcelWorkBook.xlsx&quot;&lt;br /&gt;Set objXL = CreateObject(&quot;Excel.Application&quot;)&lt;br /&gt;&amp;nbsp;&#39;if excel is opened, Set objXL = GetObject(, &quot;Excel.Application&quot;), when excel not opened or opened (workbooks won&#39;t show), objXL = CreateObject(&quot;Excel.Application&quot;)&lt;br /&gt;Set objXLWB = objXL.workbooks.Open(MyBook)</content><link rel='replies' type='application/atom+xml' href='http://rmlpanelaccess.blogspot.com/feeds/7909531894944989761/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rmlpanelaccess.blogspot.com/2012/07/open-excel-file-within-same-folder.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2398001692718253408/posts/default/7909531894944989761'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2398001692718253408/posts/default/7909531894944989761'/><link rel='alternate' type='text/html' href='http://rmlpanelaccess.blogspot.com/2012/07/open-excel-file-within-same-folder.html' title='Open Excel File within the Same Folder'/><author><name>RML Panel</name><uri>http://www.blogger.com/profile/07925140693385949898</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2398001692718253408.post-5139601556590166531</id><published>2012-07-31T13:33:00.001-07:00</published><updated>2012-07-31T13:33:14.000-07:00</updated><title type='text'>Close All Tables VBA Code</title><content type='html'>&lt;br /&gt;&amp;nbsp; &amp;nbsp; Dim TableName As AccessObject&lt;br /&gt;&amp;nbsp; &amp;nbsp; With CurrentData&lt;br /&gt;&amp;nbsp; &amp;nbsp; For Each TableName In .AllTables&lt;br /&gt;&amp;nbsp; &amp;nbsp; If TableName.IsLoaded Then&lt;br /&gt;&amp;nbsp; &amp;nbsp; DoCmd.Close acTable, TableName.Name, acSaveYes&lt;br /&gt;&amp;nbsp; &amp;nbsp; End If&lt;br /&gt;&amp;nbsp; &amp;nbsp; Next TableName&lt;br /&gt;&amp;nbsp; &amp;nbsp; End With&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://rmlpanelaccess.blogspot.com/feeds/5139601556590166531/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rmlpanelaccess.blogspot.com/2012/07/close-all-tables-vba-code.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2398001692718253408/posts/default/5139601556590166531'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2398001692718253408/posts/default/5139601556590166531'/><link rel='alternate' type='text/html' href='http://rmlpanelaccess.blogspot.com/2012/07/close-all-tables-vba-code.html' title='Close All Tables VBA Code'/><author><name>RML Panel</name><uri>http://www.blogger.com/profile/07925140693385949898</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2398001692718253408.post-6777200589144733044</id><published>2012-07-26T12:35:00.000-07:00</published><updated>2012-07-26T12:35:26.274-07:00</updated><title type='text'>Access Number Data Type Field Size</title><content type='html'>&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;background-color: white;&quot;&gt;Byte — Use for integers that range from 0 to 255. Storage requirement is 1 byte.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;background-color: white;&quot;&gt;Integer — Use for integers that range from -32,768 to 32,767. Storage requirement is 2 bytes.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;background-color: white;&quot;&gt;Long Integer — Use for integers that range from -2,147,483,648 to 2,147,483,647. Storage requirement is 4 bytes.&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;background-color: white;&quot;&gt;Single   Use for numeric floating point values that range from -3.4 x 10E38 to 3.4 x 10E38 and up to seven significant digits. Storage requirement is 4 bytes.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;background-color: white;&quot;&gt;Double   Use for numeric floating point values that range from -1.797 x 10E308 to 1.797 x 10E308 and up to fifteen significant digits. Storage requirement is 8 bytes.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;background-color: white;&quot;&gt;Replication ID   Use for storing a globally unique identifier required for replication. Storage requirement is 16 bytes. Note that replication is not supported using the .accdb file format.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;background-color: white;&quot;&gt;Decimal   Use for numeric values that range from -9.999... x 10E27 to 9.999... x 10E27. Storage requirement is 12 bytes.&lt;br /&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;For&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;best performance, always specify the smallest sufficient Field Size.&lt;br /&gt;&lt;br /&gt;(Quoted from&amp;nbsp;&lt;a href=&quot;http://office.microsoft.com/en-us/access-help/introduction-to-data-types-and-field-properties-HA010233292.aspx#BM2g&quot; target=&quot;_blank&quot;&gt;Microsoft.com&lt;/a&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://rmlpanelaccess.blogspot.com/feeds/6777200589144733044/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rmlpanelaccess.blogspot.com/2012/07/access-number-data-type-field-size.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2398001692718253408/posts/default/6777200589144733044'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2398001692718253408/posts/default/6777200589144733044'/><link rel='alternate' type='text/html' href='http://rmlpanelaccess.blogspot.com/2012/07/access-number-data-type-field-size.html' title='Access Number Data Type Field Size'/><author><name>RML Panel</name><uri>http://www.blogger.com/profile/07925140693385949898</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>