|
Private Sub cmd詳細d_Click()
On Error GoTo Err_cmd詳細_Click
Dim stDocName As String
stDocName = ChrW(113) & ChrW(114) & ChrW(121) & ChrW(32) & ChrW(12522) & ChrW(12540) & ChrW(12473) & ChrW(20250) & ChrW(31038) & ChrW(12463) & ChrW(12522) & ChrW(12456)
DoCmd.OpenQuery stDocName, acNormal, acEdit
Exit_cmd リース会社_Click:
Exit Sub
Err_cmd リース会社_Click:
MsgBox Err.Description
Resume Exit_cmd詳細_Click
Private Sub cmdAZ_Click()
Call setFilter("A-Z")
End Sub
Private Sub cmdあ_Click()
Call setFilter("ア-オ")
End Sub
Private Sub cmdカ_Click()
Call setFilter("カ-ゴ")
End Sub
Private Sub cmdサ_Click()
Call setFilter("サ-ド")
End Sub
Private Sub cmdタ_Click()
Call setFilter("タ-ド")
End Sub
Private Sub cmdナ_Click()
Call setFilter("ナ-ノ")
End Sub
Private Sub cmdハ_Click()
Call setFilter("ハ-ボ")
End Sub
Private Sub cmdマ_Click()
Call setFilter("マ-モ")
End Sub
Private Sub cmdヤ_Click()
Call setFilter("ヤ-ヨ")
End Sub
Private Sub cmdラ_Click()
Call setFilter("ラ-ロ")
End Sub
Private Sub cmdワ_Click()
Call setFilter("ワ-ン")
End Sub
Private Function setFilter(strItem As String)
Dim strCrit As String
Dim StrOrder As String
If Me.フィルタ対象 = 1 Then
strCrit = "部門名フリガナ like `[" & strItem & "]*`"
StrOrder = "部門名フリガナ"
Else
strCrit = "リース会社フリガナ like `[" & strItem & "]*`"
StrOrder = "リース会社フリガナ"
End If
Me.Filter = strCrit
Me.OrderBy = StrOrder
Me.FilterOn = True
Me.OrderByOn = True
End Function
Private Sub cmd詳細_Click()
End Sub
Private Sub 抽出解除_Click()
Me.Filter = ""
Me.OrderBy = ""
Me.FilterOn = False
Me.OrderByOn = False
End Sub
上記のVBAで Me.Filter = strCrit で、実行時エラー3125が発生してしまいます。
初心者で全く分からないので、よければご教授して頂けると嬉しいです。
|
|