' program causing an error with an undifined variable Public Sub main() Dim x As Integer x = 3 f() End Sub Public Sub f() Dim Python2VBText As New TextBox Python2VBText.Text = x ' error: f does not know about the x defined in main + vbNewLine Python2VBText.MultiLine = True Python2VBText.Width = 200 Python2VBText.Height = 100 Form1.Controls.Add(Python2VBText) End Sub 'main()