<?xml version="1.0" encoding="UTF-8" ?>
<feed xml:lang="ja" xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:thr="http://purl.org/syndication/thread/1.0">
  <title type="text">Access-Tips</title>
  <subtitle type="html">アクセス小技集</subtitle>
  <link rel="self" type="application/atom+xml" href="https://accesstips.blog.shinobi.jp/atom"/>
  <link rel="alternate" type="text/html" href="https://accesstips.blog.shinobi.jp/"/>
  <updated>2009-08-02T21:43:33+09:00</updated>
  <author><name>YM</name></author>
  <generator uri="//www.ninja.co.jp/blog/" version="0.9">忍者ブログ</generator>
  <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" />
  <entry>
    <id>accesstips.blog.shinobi.jp://entry/4</id>
    <link rel="alternate" type="text/html" href="https://accesstips.blog.shinobi.jp/%E3%83%95%E3%82%A9%E3%83%BC%E3%83%A0/%E7%B7%A8%E9%9B%86%E3%81%A7%E3%81%8D%E3%81%AA%E3%81%84%E3%83%95%E3%82%A9%E3%83%BC%E3%83%A0%EF%BC%88%E3%82%B9%E3%83%8A%E3%83%83%E3%83%97%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88%E5%88%A9%E7%94%A8%EF%BC%89" />
    <published>2009-09-04T18:02:41+09:00</published> 
    <updated>2009-09-04T18:02:41+09:00</updated> 
    <category term="フォーム" label="フォーム" />
    <title>編集できないフォーム（スナップショット利用）</title>
    <content mode="escaped" type="text/html" xml:lang="utf-8"> 
      <![CDATA[編集できない参照専用のフォームを作成する方法はいくつかありますが、今回は「スナップショット」を利用した方法です。<br />
<br />
フォームのプロパティで「レコードセット」を「スナップショット」に設定します。<br />
<a href="//accesstips.blog.shinobi.jp/File/109a562f.gif" target="_blank"><img border="0" align="left" src="//accesstips.blog.shinobi.jp/Img/1252054858/" alt="109a562f.gif" /></a><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br type="_moz" />]]> 
    </content>
    <author>
            <name>YM</name>
        </author>
  </entry>
  <entry>
    <id>accesstips.blog.shinobi.jp://entry/3</id>
    <link rel="alternate" type="text/html" href="https://accesstips.blog.shinobi.jp/%E3%83%95%E3%82%A9%E3%83%BC%E3%83%A0/%E6%B0%97%E3%81%AE%E5%88%A9%E3%81%84%E3%81%9F%E6%97%A5%E4%BB%98%E8%A1%A8%E7%A4%BA%20date%E9%96%A2%E6%95%B0" />
    <published>2009-08-08T00:00:12+09:00</published> 
    <updated>2009-08-08T00:00:12+09:00</updated> 
    <category term="フォーム" label="フォーム" />
    <title>気の利いた日付表示 Date関数</title>
    <content mode="escaped" type="text/html" xml:lang="utf-8"> 
      <![CDATA[今日はフォームやレポートに必要な日付の表示についてです。<br />
通常、　=date() 　とコントロールソースに指定しますね。すると表示はこんな感じになります。&darr;<br />
<br />
2009/08/07<br />
<br />
これだとちょっと味気ないと思いませんか？書式を設定することで表示を変えてみましょう。<br />
<br />
・プロパティ<br />
コントロールソース：=Date()<br />
書式：yyyy\年mm\月dd&quot;日(&quot;aaaa)<br />
<a href="//accesstips.blog.shinobi.jp/File/fc3ebf04.gif" target="_blank"><img border="0" align="left" src="//accesstips.blog.shinobi.jp/Img/1249656844/" alt="fc3ebf04.gif" /></a><br />
<br />
<br />
<br />
・実際の表示<br />
2009年08月07日(金曜日)<br />
これで、だいぶ表情が変わりました。更に1～9の時、頭につく「0」をとりたい場合は、<br />
書式：yyyy\年m\月d&quot;日(&quot;aaaa)<br />
と設定。すると<br />
2009年8月7日(金曜日)<br />
いかがですか？お試しください。<br />
<br />
Access専門開発なら＞＞　http://homepage3.nifty.com/baycubic/<br />
<br />
<br />
<br type="_moz" />]]> 
    </content>
    <author>
            <name>YM</name>
        </author>
  </entry>
  <entry>
    <id>accesstips.blog.shinobi.jp://entry/2</id>
    <link rel="alternate" type="text/html" href="https://accesstips.blog.shinobi.jp/vba/access%E3%81%8B%E3%82%89excel%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%EF%BC%88%E6%8C%87%E5%AE%9A%E3%81%97%E3%81%9F%E3%82%BB%E3%83%AB%EF%BC%89%E3%81%AB%E3%83%87%E3%83%BC%E3%82%BF%E5%87%BA%E5%8A%9B" />
    <published>2009-08-04T03:18:36+09:00</published> 
    <updated>2009-08-04T03:18:36+09:00</updated> 
    <category term="VBA" label="VBA" />
    <title>AccessからExcelファイル（指定したセル）にデータ出力</title>
    <content mode="escaped" type="text/html" xml:lang="utf-8"> 
      <![CDATA[AccessからExcelにデータ出力したい場面があります。すでにExcelのフォーマットが出来ているような場合、自動で指定のExcelファイルの指定した場所へ流し込みたいです。<br />
<br />
※Excelのバージョンは2000を想定しました。<br />
※VBE参照設定で「Microsoft Excel Objects Library 」にチェックを。Excel2000の場合は9.0.。<br />
※指定のExcelファイルは、Cドライブ直下にあることを想定。<br />
※ＷindowsVistaの場合、ユーザーアカウント制御（UAC）をOFFにします。<br />
<br />
<span style="background-color: rgb(51, 153, 102);"><span style="background-color: rgb(51, 153, 102);">&rsquo;----ここから</span></span><br />
Function ToExcel()<br />
<br />
On Error GoTo エラー<br />
<br />
<br />
&nbsp;&nbsp;&nbsp; Dim cn As ADODB.Connection<br />
&nbsp;&nbsp;&nbsp; Dim rs As ADODB.Recordset<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp; Set cn = CurrentProject.Connection<br />
&nbsp;&nbsp;&nbsp; Set rs = New ADODB.Recordset<br />
&nbsp;&nbsp;&nbsp; rs.Open &quot;<span style="background-color: rgb(51, 153, 102);">テーブル名またはクエリ名をここに入れる</span>&quot;, cn, adOpenKeyset, adLockOptimistic<br />
<br />
&nbsp;&nbsp;&nbsp; Dim objEXE As Object<br />
&nbsp;&nbsp;&nbsp; Dim strmsg As String<br />
&nbsp;&nbsp;&nbsp; Dim intmsg As Integer<br />
&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp; strmsg = &quot;Ms Excelへデータを出力しますか ？&quot;<br />
&nbsp;&nbsp;&nbsp; intmsg = msgbox(strmsg, 17, &quot;管理者&quot;)<br />
<br />
&nbsp;&nbsp;&nbsp; If intmsg = 1 Then<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />
Set cn = CurrentProject.Connection<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="background-color: rgb(51, 153, 102);"> '出力先のMs Excelを利用できるように設定します。</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set objEXE = CreateObject(&quot;Excel.Application.9&quot;) <span style="background-color: rgb(51, 153, 102);">'Excel2000の場合</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="background-color: rgb(51, 153, 102);">'Excelファイルのパスを指定します。</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; objEXE.Workbooks.Open (&quot;C:\sample.xls&quot;)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="background-color: rgb(51, 153, 102);"> 'Sheet名を指定します。</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; objEXE.Worksheets(&quot;Sheet1&quot;).Select<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="background-color: rgb(51, 153, 102);">'例.セルB5を基点としてデータを出力します。</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; objEXE.Cells(5, 2).CopyFromRecordset rs<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; objEXE.Visible = True<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rs.Close: Set rs = Nothing<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cn.Close: Set cn = Nothing<br />
<br />
&nbsp;&nbsp;&nbsp; Else<br />
&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; msgbox &quot;処理を中止しました&quot;, 1, &quot;管理者&quot;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp; End If<br />
&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp; Exit Function<br />
&nbsp;&nbsp;&nbsp; <br />
エラー:<br />
<br />
&nbsp;&nbsp;&nbsp; msgbox &quot;Error番号：&quot; &amp; err.Number &amp; vbNewLine &amp; _<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;Error内容：&quot; &amp; err.Description, 16, &quot;管理者&quot;<br />
&nbsp;&nbsp;&nbsp; End<br />
<br />
End Function<br />
<span style="background-color: rgb(51, 153, 102);">'---ここまで</span><br />
<br />
イベントプロシージャのクリックイベント等に指定してください。<br />
<br />
Access専門開発なら＞＞　http://homepage3.nifty.com/baycubic/<br />
<br />
<br type="_moz" />]]> 
    </content>
    <author>
            <name>YM</name>
        </author>
  </entry>
  <entry>
    <id>accesstips.blog.shinobi.jp://entry/1</id>
    <link rel="alternate" type="text/html" href="https://accesstips.blog.shinobi.jp/%E3%83%95%E3%82%A9%E3%83%BC%E3%83%A0/%E3%83%95%E3%82%A3%E3%83%BC%E3%83%AB%E3%83%89%E3%81%AE%E3%82%AB%E3%83%BC%E3%82%BD%E3%83%AB%E9%81%B8%E6%8A%9E%E7%8A%B6%E6%85%8B%E3%81%AE%E5%A4%89%E6%9B%B4%EF%BC%88%EF%BD%81%EF%BD%83%EF%BD%83%EF%BD%85%EF%BD%93%EF%BD%93%EF%BC%89" />
    <published>2009-08-02T21:50:24+09:00</published> 
    <updated>2009-08-02T21:50:24+09:00</updated> 
    <category term="フォーム" label="フォーム" />
    <title>フィールドのカーソル選択状態の変更（Ａｃｃｅｓｓ）</title>
    <content mode="escaped" type="text/html" xml:lang="utf-8"> 
      <![CDATA[Acceesでフォームを作る際、既定値が設定出来ますが、フォームを開いたときにこの指定した既定値の後ろにカーソルを置きたい時がありますね。<br />
<a href="//accesstips.blog.shinobi.jp/File/e32160cc.gif" target="_blank"><img border="0" align="left" src="//accesstips.blog.shinobi.jp/Img/1249219193/" alt="e32160cc.gif" /></a>&larr;こんな時・・・<br />
<br />
ツール&rarr;オプション&rarr;キーボードを選択し、「フィールドの最後に移動」を選択します。<br />
<br />
<a href="//accesstips.blog.shinobi.jp/File/e7cca3c1.gif" target="_blank"><img border="0" align="left" src="//accesstips.blog.shinobi.jp/Img/1249219351/" alt="e7cca3c1.gif" /></a><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<a href="//accesstips.blog.shinobi.jp/File/63385ff0.gif" target="_blank"><img border="0" align="left" src="//accesstips.blog.shinobi.jp/Img/1249219547/" alt="63385ff0.gif" /></a>&rarr;既定値の後ろにカーソルがきた<br />
<br />
<br />
<br />
Access専門開発なら＞＞　http://homepage3.nifty.com/baycubic/<br type="_moz" />]]> 
    </content>
    <author>
            <name>YM</name>
        </author>
  </entry>
</feed>