<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>p2p.wrox.com Forums - Access VBA</title>
		<link>http://p2p.wrox.com</link>
		<description>Discuss using VBA for Access programming.</description>
		<language>en</language>
		<lastBuildDate>Sat, 21 Nov 2009 10:07:27 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://p2p.wrox.com/images/misc/rss.jpg</url>
			<title>p2p.wrox.com Forums - Access VBA</title>
			<link>http://p2p.wrox.com</link>
		</image>
		<item>
			<title>Form Record Source</title>
			<link>http://p2p.wrox.com/access-vba/77050-form-record-source.html</link>
			<pubDate>Mon, 16 Nov 2009 11:29:30 GMT</pubDate>
			<description>Hi 
I am using this this to fill up my continous form with different text field in it

Dim cmd As New ADODB.Command
 Dim prm As ADODB.Parameter
 Dim...</description>
			<content:encoded><![CDATA[<div>Hi <br />
I am using this this to fill up my continous form with different text field in it<br />
<br />
Dim cmd As New ADODB.Command<br />
 Dim prm As ADODB.Parameter<br />
 Dim r As New ADODB.Recordset<br />
 <br />
 cmd.ActiveConnection = SQLcon<br />
 cmd.CommandType = adCmdStoredProc<br />
 cmd.CommandText = &quot;sp_Order&quot;<br />
 <br />
 Set prm = cmd.CreateParameter(&quot;@SDATE&quot;, adDBTimeStamp, adParamInput)<br />
 cmd.Parameters.Append prm<br />
 cmd.Parameters(&quot;@SDATE&quot;).Value = Format(Me!DateSearch, &quot;yyyy/mm/dd hh:mm:ss&quot;)<br />
 <br />
 Set prm = cmd.CreateParameter(&quot;@CUSER&quot;, adInteger, adParamInput)<br />
 cmd.Parameters.Append prm<br />
 cmd.Parameters(&quot;@CUSER&quot;).Value = CUser()<br />
 Set r = cmd.Execute()<br />
  <br />
<b>'THIS LINE GIVE ERROR<br />
 'Set Me.Recordset = r</b><br />
 <br />
'THIS CODE BELOW ABLE TO PRING VALUES IN DEBUG SCREEN<br />
 While Not r.EOF<br />
Debug.Print r!Rep &amp; &quot; , &quot; &amp; r!MID &amp; &quot; , &quot; &amp; r!TDate &amp; &quot; , &quot; &amp; r!Value &amp; &quot; , &quot; &amp; r!SDATE &amp; &quot; , &quot; &amp; r!ElecOrMach<br />
 r.MoveNext<br />
 Wend<br />
<br />
any idea <br />
<br />
Regards<br />
<br />
Ayaz</div>

]]></content:encoded>
			<category domain="http://p2p.wrox.com/access-vba-80/">Access VBA</category>
			<dc:creator>ayazhoda</dc:creator>
			<guid isPermaLink="true">http://p2p.wrox.com/access-vba/77050-form-record-source.html</guid>
		</item>
		<item>
			<title>SubForm Refresh Delay Problem</title>
			<link>http://p2p.wrox.com/access-vba/76925-subform-refresh-delay-problem.html</link>
			<pubDate>Fri, 06 Nov 2009 04:41:37 GMT</pubDate>
			<description>Created one main form contains a SubForm inside. There is two buttons on the main form, indicated by
a) Save button
b) Refresh button

This button...</description>
			<content:encoded><![CDATA[<div>Created one main form contains a SubForm inside. There is two buttons on the main form, indicated by<br />
a) Save button<br />
b) Refresh button<br />
<br />
This button will insert data through the <b>insert SQL string</b> into seperate MS Access but under the same server before the data is displayed on the SubForm.<br />
<br />
Question: <br />
Why I need to click the Refresh button 2 to 3 times in order to obtain the latest info ? Below is my code<br />
<br />
<div style="margin:20px; margin-top:5px; ">
	<div class="smallfont" style="margin-bottom:2px">Quote:</div>
	<table cellpadding="6" cellspacing="0" border="0" width="100%">
	<tr>
		<td class="alt2">
			<hr />
			
				Private Sub RefreshSubForm()<br />
    DoCmd.Requery (&quot;SubForm_V_QATransaction&quot;)<br />
    Me.Refresh<br />
    Me!SubForm_V_QATransaction.Form.Refresh<br />
    Me!SubForm_V_QATransaction.Form.Filter = &quot;StartDate Is Null or EndDate Is Null&quot;<br />
    Me!SubForm_V_QATransaction.Form.FilterOn = True<br />
End Sub
			
			<hr />
		</td>
	</tr>
	</table>
</div>Any chance not to allow the few clicks exercise, on the other hand, type in few VBA codes to act as timer for delay purpose like DoEvents for example .<br />
<br />
(Tried before the DoEvents method, however, result remain the same)</div>

]]></content:encoded>
			<category domain="http://p2p.wrox.com/access-vba-80/">Access VBA</category>
			<dc:creator>cheer</dc:creator>
			<guid isPermaLink="true">http://p2p.wrox.com/access-vba/76925-subform-refresh-delay-problem.html</guid>
		</item>
		<item>
			<title>VBA - Lookup</title>
			<link>http://p2p.wrox.com/access-vba/76913-vba-lookup.html</link>
			<pubDate>Thu, 05 Nov 2009 09:01:17 GMT</pubDate>
			<description>Hi
My previous post about loop through datasets probably was not that clear
 
What I am trying to do is perform the same action as Excel Lookup...</description>
			<content:encoded><![CDATA[<div>Hi<br />
My previous post about loop through datasets probably was not that clear<br />
 <br />
What I am trying to do is perform the same action as Excel Lookup function in VBA.<br />
 <br />
Where a field is searched and an associated field returned.<br />
 <br />
For example if a text box in a form shows a certain value that value is searched and if found an associated value returned to another text box.<br />
 <br />
Hope that might be clearer<br />
 <br />
Regards [:)]</div>

]]></content:encoded>
			<category domain="http://p2p.wrox.com/access-vba-80/">Access VBA</category>
			<dc:creator>ppenn</dc:creator>
			<guid isPermaLink="true">http://p2p.wrox.com/access-vba/76913-vba-lookup.html</guid>
		</item>
		<item>
			<title>Loop through fields</title>
			<link>http://p2p.wrox.com/access-vba/76868-loop-through-fields.html</link>
			<pubDate>Mon, 02 Nov 2009 19:06:56 GMT</pubDate>
			<description>Hi
 
I am reasonably familiar with the code to loop through dataset records and assign the values to variables, but I am currently stumped on...</description>
			<content:encoded><![CDATA[<div>Hi<br />
 <br />
I am reasonably familiar with the code to loop through dataset records and assign the values to variables, but I am currently stumped on something I am trying to do.<br />
I have a form with various text boxes with points values in them and calculates a total of these points into another text box. I want to loop through the fields of a table and find a value that matches the total on the form, I then want to be able to display the result in another text box on the form.As an example imagine the table as follows<br />
Field -- A--- B<br />
Value -15- ABC<br />
Value -25- DEF<br />
Value -40- GHI<br />
 <br />
If the code loops through column A and if it finds the value on the form matches 25 then I want the value DEF to be able to be displayed on the form.<br />
I thought that the code could run from the &quot;After Update&quot; event on a text box or combo box.<br />
Thank you in advance, hoping you can understand my logic<br />
Best regards</div>

]]></content:encoded>
			<category domain="http://p2p.wrox.com/access-vba-80/">Access VBA</category>
			<dc:creator>ppenn</dc:creator>
			<guid isPermaLink="true">http://p2p.wrox.com/access-vba/76868-loop-through-fields.html</guid>
		</item>
		<item>
			<title>Data Cannot Displayed On SubForm  Correctly</title>
			<link>http://p2p.wrox.com/access-vba/76821-data-cannot-displayed-subform-correctly.html</link>
			<pubDate>Fri, 30 Oct 2009 02:14:10 GMT</pubDate>
			<description>I have created one main form, under this main form, there is one subform (subform name:  *SubForm_Production_Schedule*) and one button. When this...</description>
			<content:encoded><![CDATA[<div><font size="2">I have created one main form, under this main form, there is one subform (subform name:  </font><font size="2"><b>SubForm_Production_Schedule</b>) </font><font size="2">and one button. When this button is clicked, I need the data to display on subform base on certain criteria. Below is the part of the code under the button click event<br />
<br />
<div style="margin:20px; margin-top:5px; ">
	<div class="smallfont" style="margin-bottom:2px">Quote:</div>
	<table cellpadding="6" cellspacing="0" border="0" width="100%">
	<tr>
		<td class="alt2">
			<hr />
			
				Me!SubForm_Production_Schedule.SourceObject = &quot;Table.Production_Schedule&quot;<br />
<br />
Me!SubForm_Production_Schedule.Form.RecordSource = &quot;select * from Production_Schedule where Login='&quot; &amp; txtOperator.Value &amp; &quot;'&quot;<br />
<br />
Me!SubForm_Production_Schedule.Requery<br />
<br />
Me.Refresh<br />
<br />
Me.Repaint
			
			<hr />
		</td>
	</tr>
	</table>
</div></font><br />
<br />
However, there isn't any data appear after the button is clicked. When I search back the table <b>Production_Schedule</b>, in fact there are more than 100 rows of data available.<br />
<br />
Anyone can advise the what goes wrong to the above coding ? I am using the MS Access 2000.</div>

]]></content:encoded>
			<category domain="http://p2p.wrox.com/access-vba-80/">Access VBA</category>
			<dc:creator>cheer</dc:creator>
			<guid isPermaLink="true">http://p2p.wrox.com/access-vba/76821-data-cannot-displayed-subform-correctly.html</guid>
		</item>
		<item>
			<title>DAO</title>
			<link>http://p2p.wrox.com/access-vba/76752-dao.html</link>
			<pubDate>Sat, 24 Oct 2009 18:39:48 GMT</pubDate>
			<description>I am a novice and trying to learn VB; therefore, I purchased this book.  I am on Chapter 6:  Using DAO to Access Data, page 111.  I am not...</description>
			<content:encoded><![CDATA[<div>I am a novice and trying to learn <acronym title="vBulletin">VB</acronym>; therefore, I purchased this book.  I am on Chapter 6:  Using DAO to Access Data, page 111.  I am not understanding it.  Anyway, I am trying to understand some code I keep seeing, for example:<br />
<blockquote><font color="Blue">Dim dbMyDB As DAO.Database<br />
Set dbMyDB = DBEngine.Workspace(0).Databases(0)</font></blockquote>The explanations I have read are not clear to me.  <br />
<br />
What is DAO and workspace?  I need non-technical explanations or explanations explained simple enough that a dummy can understand it.  I need a clearer understanding of DAO.<br />
<br />
My thoughts right now are:  DAO is like a library that holds templates to do this and that to your data--for instance, to delete a record, the code is store in a DAO library for delete--you have to go to that library, retrieve the template for delete, save the template to your document, and then use the template to perform a deletion.<br />
<br />
Any simple explanations and/or examples are appreciated.<br />
<br />
Thanks!</div>

]]></content:encoded>
			<category domain="http://p2p.wrox.com/access-vba-80/">Access VBA</category>
			<dc:creator>lmcc007</dc:creator>
			<guid isPermaLink="true">http://p2p.wrox.com/access-vba/76752-dao.html</guid>
		</item>
		<item>
			<title><![CDATA[Run-time error '3296': Join expression not supported.]]></title>
			<link>http://p2p.wrox.com/access-vba/76725-run-time-error-3296-join-expression-not-supported.html</link>
			<pubDate>Fri, 23 Oct 2009 13:23:17 GMT</pubDate>
			<description>Hello,
Please could someone help me?
I have built 2 Access queries, one is a select query that gathers all of the data required and the second is a...</description>
			<content:encoded><![CDATA[<div><font face="Arial"><font size="3">Hello,<br />
Please could someone help me?<br />
I have built 2 Access queries, one is a select query that gathers all of the data required and the second is a crosstab that uses the results from the first query and populates it into the correct format needed (I.E. all of the dates as column headers)<br />
Both of these queries run fine in Access but when trying to put them into a module I am getting the &quot;Run-time error '3296': Join expression not supported.&quot; (Bit of code below in <b><font face="Times New Roman"><font size="2">BOLD</font></font></b>)<br />
Here is the code used in the module:<br />
As you can see I have put in a Do While loop in to run the queries using 'Agent' as a parameter.<br />
If anyone can help I would be very grafetful as I know have no hair and no skin left on my teeth!<br />
<br />
Thanks</font></font><br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">Option Compare Database<br />
Option Explicit<br />
Sub Productivity_Daily_Report()<br />
<br />
Dim rsResources As Recordset<br />
Dim rsFirst As Recordset<br />
Dim rsSecond As Recordset<br />
<br />
Dim sqlResources As String<br />
Dim sqlFirst As String<br />
Dim sqlSecond As String<br />
<br />
Dim app As New Excel.Application, excelws<br />
Dim Agent As String<br />
<br />
sqlResources = &quot;Select * from Resources;&quot;<br />
Set rsResources = CurrentDb.OpenRecordset(sqlResources)<br />
<br />
If rsResources.EOF And rsResources.BOF Then<br />
&nbsp; &nbsp; Beep<br />
&nbsp; &nbsp; MsgBox &quot;No records!&quot;<br />
&nbsp; &nbsp; rsResources.Close<br />
&nbsp; &nbsp; GoTo end_it<br />
End If<br />
<br />
Set app = CreateObject(&quot;Excel.application&quot;)<br />
<br />
Set excelws = app.Application<br />
With excelws<br />
.Visible = True<br />
<br />
Do While Not rsResources.EOF<br />
<br />
Agent = rsResources!FullName<br />
<br />
app.Workbooks.Open &quot;Z:\Productivity\Blank.xls&quot;, , True<br />
<br />
'*********** First Query ***************<br />
<br />
sqlFirst = &quot;SELECT Main.FPO, Main.Rec_Date, AI_Queue.[Task Name], Count(Main.MainId) AS CountOfMainId&quot; &amp; vbCrLf &amp; _<br />
&quot;FROM Production_Selection, Main INNER JOIN AI_Queue ON Main.[A&amp;I Queue] = AI_Queue.[A&amp;I Queue]&quot; &amp; vbCrLf &amp; _<br />
&quot;WHERE (((Weekday([Main].[Rec_Date]))&lt;&gt;7 And (Weekday([Main].[Rec_Date]))&lt;&gt;1) AND ((Main.Rec_Date) Between [StartDate] And [EndDate]) AND ((Main.FPO)='&quot; &amp; Agent &amp; &quot;'))&quot; &amp; vbCrLf &amp; _<br />
&quot;GROUP BY Main.FPO, Main.Rec_Date, AI_Queue.[Task Name]&quot;<br />
<br />
Set rsFirst = CurrentDb.OpenRecordset(sqlFirst, dbOpenDynaset)<br />
<br />
'************* Second Query ***************<br />
<br />
sqlSecond = &quot;TRANSFORM Sum(rsFirst!CountOfMainId) AS SumOfCountOfMainId&quot; &amp; vbCrLf &amp; _<br />
&quot;SELECT rsFirst!FPO, rsFirst![Task Name]&quot; &amp; vbCrLf &amp; _<br />
<b>&quot;FROM Days_Month LEFT JOIN rsFirst ON Days_Month.Date = rsFirst!Rec_Date&quot; </b>&amp; vbCrLf &amp; _<br />
&quot;GROUP BY rsFirst!FPO, rsFirst![Task Name]&quot; &amp; vbCrLf &amp; _<br />
&quot;PIVOT Days_Month.Date&quot;<br />
<br />
Set rsSecond = CurrentDb.OpenRecordset(sqlSecond, dbOpenDynaset)<br />
<br />
<b>.Range(&quot;A2&quot;).copyfromrecordset rsSecond</b><br />
<br />
excelws.activeworkbook.SaveAs (&quot;Z:\Productivity\BlankReport_&quot; &amp; rsResources!FullName &amp; &quot;.xls&quot;)<br />
excelws.activeworkbook.Close<br />
<br />
rsResources.MoveNext<br />
Loop<br />
End With<br />
Set excelws = Nothing<br />
Set app = Nothing<br />
<br />
rsResources.Close<br />
<br />
end_it:<br />
Set rsResources = Nothing<br />
End Sub</code><hr />
</div></div>

]]></content:encoded>
			<category domain="http://p2p.wrox.com/access-vba-80/">Access VBA</category>
			<dc:creator>ashley.baker</dc:creator>
			<guid isPermaLink="true">http://p2p.wrox.com/access-vba/76725-run-time-error-3296-join-expression-not-supported.html</guid>
		</item>
	</channel>
</rss>
