質問編集履歴

2

追記

2019/07/31 01:15

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -101,3 +101,45 @@
101
101
  End With
102
102
 
103
103
  ```
104
+
105
+
106
+
107
+ ##追加質問
108
+
109
+ シングルクォーテーションでの入力でも、文字列認識させたく同じように下記のコードを書いてみたのですがシングルクォーテーションだけうまく行かないので、わかる方いましたらお願いします。
110
+
111
+
112
+
113
+ ```VBA
114
+
115
+ '住所
116
+
117
+
118
+
119
+ Dim wAddress As String
120
+
121
+
122
+
123
+ wAddress = Nz(Me!Text_Address, "")
124
+
125
+
126
+
127
+ If wAddress <> "" Then
128
+
129
+
130
+
131
+ wAddress = Replace(wAddress, "*", "[*]")
132
+
133
+
134
+
135
+ wAddress = Replace(wAddress, "'", "[']")
136
+
137
+
138
+
139
+ wFilter = wFilter & "and F_Address like '*" & [wAddress] & "*'"
140
+
141
+
142
+
143
+ End If
144
+
145
+ ```

1

追記

2019/07/31 01:15

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -55,3 +55,49 @@
55
55
 
56
56
 
57
57
  わかる方いましたら、アドバイスの方お願いします。
58
+
59
+
60
+
61
+ ##追記
62
+
63
+ ```VBA
64
+
65
+ '顧客名
66
+
67
+
68
+
69
+ Dim wName As String
70
+
71
+
72
+
73
+ wName = Nz(Me!Text_CustomerName, "")
74
+
75
+
76
+
77
+ If wName <> "" Then
78
+
79
+
80
+
81
+ wName = Replace(wName, "*", "[*]")
82
+
83
+ wName = Replace(wName, """", "[""]")
84
+
85
+
86
+
87
+ wFilter = wFilter & "and F_CustomerName like '*" & wName & "*'"
88
+
89
+
90
+
91
+ End If
92
+
93
+
94
+
95
+ With Me!Sub_CustomerMaster.Form
96
+
97
+ .Filter = wFilter
98
+
99
+ .FilterOn = True
100
+
101
+ End With
102
+
103
+ ```