2016-04-06 4 views
1

Debug.printの結果をイミディエイトウィンドウに印刷するのではなく、フォーム上のセルに印刷する方法はありますか? ps。このコードを借りてパスワードを生成しました。Accessの列またはテキストフィールドにDebug.printを印刷する方法は?

Private Sub Command23_Click() 
Dim s As String * 8 'fixed length string with 8 characters 
Dim n As Integer 
Dim ch As Integer 'the character 
For n = 1 To Len(s) 'don't hardcode the length twice 
    Do 
     ch = Rnd() * 127 'This could be more efficient. 
     '48 is '0', 57 is '9', 65 is 'A', 90 is 'Z', 97 is 'a', 122 is 'z'. 
    Loop While ch < 48 Or ch > 57 And ch < 65 Or ch > 90 And ch < 97 Or ch > 122 
    Mid(s, n, 1) = Chr(ch) 'bit more efficient than concatenation 
Next 

Debug.Print s 
End Sub 

答えて

1

フォームにテキストボックスを追加し、テキストボックスのValueとしてsを割り当てる...

Debug.Print s 
Me!txtDebug.Value = s 

テキストボックスValue(代わりの交換にsを追加したい場合Value)、新しいsの値を新しい行として追加することができます。

Me!txtDebug.Value = Me!txtDebug.Value & vbCrLf & s 
+0

テーブルのセルに印刷するのはどうですか? – wisenhiemer

+0

私はそれを理解したことはありません。ご協力ありがとうございました。 – wisenhiemer

関連する問題