Date: Tue, 6 Feb 2001 19:58:43 +0900
From: who@example.co.jp
¤¿¤¤¶¤ï¤Ç¤¹¡£
>¤½¤ì¤¾¤ì¤Î¥¯¥é¥¤¥¢¥ó¥È¤ÇÀܳ¤Î³Îǧ¤¬¤Ç¤¤ì¤Ð¡¢£¸£°¡ó¤ÏÂç¾æÉפǤ·¤ç¤¦
>¤¿¤À¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤òÆ°¤«¤¹Á°¤Ë¡¢³Æ¥¯¥é¥¤¥¢¥ó¥È¤«¤é¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î
>¥Æ¡¼¥Ö¥ë¤ä¥Ó¥å¡¼¤Ê¤É¤ò¼êÆ°¤Ç³«¤¤¤¿¤ê¡¢¥¹¥È¥¢¥É¥×¥í¥·¡¼¥¸¥ã¤ò¼Â¹Ô
>¤·¤¿¤ê¡¢¥Í¥Ã¥È¥ï¡¼¥¯±Û¤·¤Î¥¯¥é¥¤¥¢¥ó¥È¥µ¡¼¥Ð¡¼µ¡Ç½¤¬Æ¯¤¯¤«¤É¤¦¤«
>³Îǧ¤·¤¿Êý¤¬Îɤ¤¤«¤â¡©
°ìÄ̤ê¤ä¤Ã¤Æ¤ß¤Þ¤·¤¿¤¬¡¢ÆäËÌäÂê¤Ê¤¯³«¤±¤ë¤·¥¹¥È¥¢¥É¥×¥í¥·¡¼¥¸¥ã¤â
¼Â¹Ô½ÐÍè¤Þ¤¹¡£
>¤½¤ì¤À¤Ã¤¿¤é¤½¤ÎÆÃÄê¤Î¥×¥í¥°¥é¥à¤ÎÃæ¤òÄ´ºº¤·¤Þ¤·¤¿¤«¡©
>¤É¤Î¤è¤¦¤Ê¸¶°øÄɵá¤ò¤µ¤ì¤¿¤Î¤Ç¤·¤ç¤¦¤«¡©
Èó¾ï¤ËŤ¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤Æ¿½¤·Ìõ̵¤¤¤Î¤Ç¤¹¤¬¡¢¥³¡¼¥É¤ò·ÇºÜ¤·¤Ê¤¤¤È²ò·è
½ÐÍè¤Ê¤¤¤Ã¤Ý¤¤¤Î¤Ç¡¢Ä¹¤¯¤Ê¤ë»ö¤ò¤ªµö¤·¤¯¤À¤µ¤¤¡£
£±¤Ä¤ÎÎã¤Ç¤¹¤¬¡¢¸¡º÷¥×¥í¥°¥é¥à¤ÎÍͤʤâ¤Î¤Ç¤¹¤¬¡¢¥Õ¥©¡¼¥à¤Ë£±£²¸Ä¤Î¥³¥ó¥Ü
¥Ü¥Ã¥¯¥¹¤Þ¤¿¤Ï¥Æ¥¥¹¥È¥Ü¥Ã¥¯¥¹¤¬¤¢¤ê¡¢¤³¤Î£±£²¸Ä¤Î¥³¥ó¥È¥í¡¼¥ë¤ËÆþÎϤµ¤ì
¤¿Ãͤò¸µ¤Ë¸¡º÷¤·¡¢·ë²Ì¤òÊ̤Υե©¡¼¥à¤ËÊÖ¤¹¤È¤¤¤¦¤â¤Î¤Ç¤¹¡£
Ëô¡¢¥³¥Þ¥ó¥É¥Ü¥¿¥ó¤È¤·¤Æ¡¢¥Õ¥©¡¼¥à¤òÊĤ¸¤ë¡¢¸¡º÷³«»Ï¡¢¸¡º÷¾ò·ï¤Î¥¯¥ê¥¢¤Î
£³¤Ä¤¬¤¢¤ê¤Þ¤¹¡£
¤¤¤Å¤ì¤Î¥³¥Þ¥ó¥É¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¤â(²¼µ(1)(4)(8)¤Î¥³¡¼¥É)
¡¡¡Ö¥¤¥Ù¥ó¥È¥×¥í¥Ñ¥Æ¥£¤Ë»ØÄꤷ¤¿¼°¡¡¥¯¥ê¥Ã¥¯»þ¤Ç¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿¡£
¡¡¡¡¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬OLE¥µ¡¼¥Ð¡¼¤Þ¤¿¤ÏActiveX¥³¥ó¥È¥í¡¼¥ë¤ÈÄÌ¿®¤·¤Æ¤¤¤ë
¡¡¡¡¤È¤¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿¡£
¤È¤Ê¤ê¤Þ¤¹¡£
(8)¤Î¾ì¹ç¤Ï¼ÂºÝ¤Ë¥Ç¡¼¥¿¥Ù¡¼¥¹¤È¤ÎÀܳ¤¬ÌäÂê¤Ë¤Ê¤Ã¤Æ¤¯¤ë¤Î¤Ç¤·¤ç¤¦¤¬¡¢
(1)(4)¤Ë¤Ä¤¤¤Æ¤Ï¡¢¥Õ¥©¡¼¥à¾å¤Î¥Ç¡¼¥¿¤ò¾Ã¤·¤¿¤ê¡¢¥Õ¥©¡¼¥à¤òÊĤ¸¤¿¤ê
¤È¤¤¤Ã¤¿¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÀܳ¤È¤ÏľÀÜ´Ø·¸Ìµ¤¤Íͤ˻פ¨¤ë¤Î¤Ç¤¹¤¬¡¦¡¦¡¦¡£
¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤Î¡ÖActiveX¥³¥ó¥È¥í¡¼¥ë¤ÈÄÌ¿®¤·¤Æ¤¤¤ë»þ¤Ë¡¦¡¦¡¦¡×¤È
¤¤¤¦¤È¤³¤í¤Ç¤Ò¤Ã¤«¤«¤Ã¤Æ¤ë¤Î¤«¤Ê¡©¤È¤â»×¤¤¤Þ¤¹¤¬¡¢¤Þ¤À¤Þ¤À½é¿´¼Ô¤Ç¤¢
¤ë°Ù¤Ë¡ÖActiveX¥³¥ó¥È¥í¡¼¥ë¤ÈÄÌ¿®¡×¤¬¥¨¥é¡¼¤Ë¤Ê¤ë¤È¤¤¤¦¤Î¤¬¤É¤¦¤¤¤¦»ö
¤Ê¤Î¤«¤âʬ¤«¤é¤Ê¤¤¾õÂ֤Ǥ¢¤ê¤Þ¤¹¡£
°Ê²¼¡¢³ºÅö¸Ä½ê¤Î¥³¡¼¥É¤Î´Ø·¸¤¹¤ë½ê¤È»×¤ï¤ì¤ëÉôʬȴ¿è
¡¡¡¡¢¨¤Þ¤À¤Þ¤À½é¿´¼Ô¤Ê¤â¤ó¤Ç¡¢¥³¡¼¥É¤¬ÍÄÃÕ¤ÇÃѤº¤«¤·¤¤¤ó¤Ç¤¹¤¬¡¦¡¦(-_-;)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(1)¥Õ¥©¡¼¥à¤òÊĤ¸¤ë¥Ü¥¿¥ó¤Î¥³¡¼¥É
Private Sub cmd_close_Click()
¡¡¡¡DoCmd.Close
End Sub
(2)¥Õ¥©¡¼¥à¤¬É½¼¨¤µ¤ì¤¿»þ¤Ë¼«Æ°Åª¤Ë¼Â¹Ô¤µ¤ì¤ë¥³¡¼¥É
Private Sub Form_Load()
¡¡¡¡¡¡ ¡¡¡¡DoCmd.Maximize
¡¡¡¡ Set Me.Recordset = Nothing
¡¡¡¡¡¡¡¡¡¡ '----<Àܳ¤ò³«»Ï>----
¡¡¡¡¡¡¡¡¡¡Call Connect_cur
End Sub
(3)¥Õ¥©¡¼¥à¤òÊĤ¸¤ë»þ¤Ë¼«Æ°Åª¤Ë¼Â¹Ô¤µ¤ì¤ë¥³¡¼¥É
Private Sub Form_Unload(Cancel As Integer)
'----<Àܳ¤òÊĤ¸¤ë>----
Call DisConnect_cur
End Sub
(4)¥Æ¥¥¹¥È¡¦¥³¥ó¥Ü¤ËÆþÎϤµ¤ì¤¿¥Ç¡¼¥¿¤ò¥¯¥ê¥¢¤¹¤ë¥³¡¼¥É
Private Sub cmd_²ò½ü_Click()
¡¡¡¡¡¡¡¡¡¡ Call ¥Ç¡¼¥¿¥¯¥ê¥¢(Me)
End Sub
(5)ɸ½à¥â¥¸¥å¡¼¥ë¤ËµºÜ¤µ¤ì¤¿¥Ç¡¼¥¿¥Ù¡¼¥¹Àܳ¥³¡¼¥É
Sub Connect_cur()
¡¡¡¡¡¡¡¡¡¡¡¡'----<¥Ç¡¼¥¿¥Ù¡¼¥¹Àܳ¤¹¤ë>----
¡¡¡¡¡¡¡¡¡¡¡¡Set CN = Application.CurrentProject.Connection
¡¡¡¡¡¡¡¡¡¡¡¡CN.CursorLocation = adUseClient
¡¡¡¡¡¡¡¡End Sub
(6)ɸ½à¥â¥¸¥å¡¼¥ë¤ËµºÜ¤µ¤ì¤¿¥Ç¡¼¥¿¥Ù¡¼¥¹ÀÚÃÇ¥³¡¼¥É
Sub DisConnect_cur()
¡¡¡¡¡¡¡¡'----<¥Ç¡¼¥¿¥Ù¡¼¥¹Àܳ¤òÊĤ¸¤ë>----
¡¡¡¡¡¡¡¡¡¡¡¡¡¡CN.Close
¡¡¡¡¡¡¡¡¡¡¡¡¡¡Set CN = Nothing
¡¡¡¡¡¡¡¡End Sub
(7)ɸ½à¥â¥¸¥å¡¼¥ë¤ËµºÜ¤µ¤ì¤¿¾ò·ï¤ò¥¯¥ê¥¢¤¹¤ë¥³¡¼¥É
Sub ¥Ç¡¼¥¿¥¯¥ê¥¢(¥Õ¥©¡¼¥à)
¡¡¡¡On Error Resume Next
¡¡¡¡¡¡¡¡¡¡Set FRM = ¥Õ¥©¡¼¥à
For Each ¥³¥ó¥È¥í¡¼¥ë In FRM.Controls
¡¡¡¡If TypeOf ¥³¥ó¥È¥í¡¼¥ë Is TextBox Or _
TypeOf ¥³¥ó¥È¥í¡¼¥ë Is ComboBox Then
¥³¥ó¥È¥í¡¼¥ë.Value = ""
¡¡¡¡End If
¡¡¡¡¡¡¡¡¡¡¡¡¡¡Next
¡¡¡¡¡¡¡¡End Sub
(8)¥Õ¥©¡¼¥à¤Î¸¡º÷³«»Ï¥Ü¥¿¥ó¥â¥¸¥å¡¼¥ë
Sub cmd_start_click()
'----<ÊÑ¿ô¤ÎÄêµÁ>----
Dim KEY(1 To 11) As String
Dim Criteria As String
Dim CrLen As Integer
Dim I As Integer
'----<Ãê½Ð¾ò·ï¤ÎÆɤ߹þ¤ß>----
'----<´Á»ú»á̾>----
If IsNull(Me!txt_»á̾) Or Me!txt_»á̾ = "" Then
KEY(1) = ""
Else
KEY(1) = "(»á̾ LIKE '%" & Me!txt_»á̾ & "%')"
End If
'----<ºÛȽ½êÁªÂò>----
If IsNull(Me!cbo_ºÛȽ½ê̾) Or Me!cbo_ºÛȽ½ê̾ = "" Then
KEY(2) = ""
Else
KEY(2) = "ºÛȽ½ê̾='" & Me!cbo_ºÛȽ½ê̾ & "'"
End If
'----<ºÛȽ½ê¼ïÊÌÁªÂò>----
If IsNull(Me!cbo_ºÛȽ½ê¼ïÊÌ) Or Me!cbo_ºÛȽ½ê¼ïÊÌ = "" Then
KEY(3) = ""
Else
KEY(3) = "ºÛȽ½ê¼ïÊÌ='" & Me!cbo_ºÛȽ½ê¼ïÊÌ & "'"
End If
'----<ºÛȽ½êÁªÂò>----
If IsNull(Me!cbo_ÃϺ۲ȺۻÙÉô̾) Or Me!cbo_ÃϺ۲ȺۻÙÉô̾ = "" Then
KEY(4) = ""
Else
KEY(4) = "ÃϺ۲ȺۻÙÉô̾='" & Me!cbo_ÃϺ۲ȺۻÙÉô̾ & "'"
End If
'----<»ö·ïÈÖ¹æǯ>----
If IsNull(Me!txt_»ö·ïâǯ) Or Me!txt_»ö·ïâǯ = "" Then
KEY(5) = ""
Else
KEY(5) = "([»ö·ïâǯ]= Me!txt_»ö·ïâǯ)"
End If
'----<»ö·ïâµ¹æ>----
If IsNull(Me!cbo_»ö·ïâµ¹æ) Or Me!cbo_»ö·ïâµ¹æ = "" Then
KEY(6) = ""
Else
KEY(6) = "[»ö·ïâµ¹æ]='" & Me!cbo_»ö·ïâµ¹æ & "'"
End If
'----<»ö·ïÈÖ¹æÈÖ¹æ>----
If IsNull(Me!txt_»ö·ïâÈÖ¹æ) Or Me!txt_»ö·ïâÈÖ¹æ = "" Then
KEY(7) = ""
Else
KEY(7) = "([»ö·ïâÈÖ¹æ]=" & Me!txt_»ö·ïâÈÖ¹æ & ")"
End If
'----<ôÅö¼Ò°÷>----
If IsNull(Me!cbo_¼Ò°÷»á̾) Or Me!cbo_¼Ò°÷»á̾ = "" Then
KEY(8) = ""
Else
KEY(8) = "(¼Ò°÷»á̾='" & Me!cbo_¼Ò°÷»á̾ & "')"
End If
'----<¥³¥á¥ó¥È>----
If IsNull(Me!txt_¥³¥á¥ó¥È) Or Me!txt_¥³¥á¥ó¥È = "" Then
KEY(9) = ""
Else
KEY(9) = "(¥³¥á¥ó¥È LIKE '%" & Me!txt_¥³¥á¥ó¥È & "%')"
End If
'----<ˡ̳¼ê³¾õ¶·>----
If IsNull(Me!cbo_ˡ̳¼ê³¾õ¶·) Or Me!cbo_ˡ̳¼ê³¾õ¶· = "" Then
KEY(10) = ""
Else
KEY(10) = "(ˡ̳¼ê³¾õ¶·='" & Me!cbo_ˡ̳¼ê³¾õ¶· & "')"
End If
'----<»ÙŹÁªÂò>----
If IsNull(Me!cbo_»ÙŹ) Or Me!cbo_»ÙŹ = "Á´»ÙŹ" Or Me!cbo_»ÙŹ = ""
Then
KEY(11) = ""
Else
KEY(11) = "Ź̾='" & Me!cbo_»ÙŹ & "'"
End If
'----<Ãê½Ð¾ò·ï¤ÎÀßÄê>----
For I = 1 To 11
If KEY(I) = "" Then
'
Else
Criteria = Criteria & KEY(I) & " AND "
End If
Next I
'----<¾ò·ï¤¬ÀßÄꤵ¤ì¤Æ¤Ê¤¤¾ì¹ç¤Ï½èÍý¤òÈ´¤±¤ë>----
If Criteria = "" Then Exit Sub
'----<ʸ»úÎóºîÀ®<FOR~NEXT¤ÇºÇ¸å¤Ë¤Ä¤¤¤¿AND¤ò½ü¤¯>----
CrLen = Len(Criteria)
Criteria = Left(Criteria, CrLen - 5)
'----<¥Õ¥£¥ë¥¿¤Î¼Â¹Ô>----
DoCmd.OpenForm "K_ˡ̳¼ê³¸¡º÷_·ë²Ì", , , Criteria¡¡¡¡'¤³¤³¤ÇÊ̤ηë²Ìɽ
¼¨ÍѤΥե©¡¼¥à
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¤¬É½¼¨¤µ¤ì¤ë¡£
End Sub
[MSDE/SQLServer¤Ë´Ø¤·¤Æ¡¢º£¡¢¤É¤ó¤Ê¤³¤È¤Ë¤ªº¤¤ê¤Ç¤¹¤«¡©] |
¤è¤í¤·¤±¤ì¤Ð¤ªº¤¤ê¤ÎÆâÍƤò¡¢ÅŻҥ᡼¥ë¤Ç¶µ¤¨¤Æ²¼¤µ¤¤¡£ |
¼ÁÌä¤òÅŻҥ᡼¥ë¤ÇºîÀ®¤¹¤ë
|
[¥¦¥£¥ó¥É¤òÊĤ¸¤ë][MSDE/SQLServer FAQ ][MSDE / MSDE2000 µ»½Ñ¥µ¥Ý¡¼¥È¾ðÊó°ìÍ÷]
|