none
Procedure, Module, Class Module. RRS feed

  • Question

  • Perhaps I have done this wrong. I inserted a module called importdata. In the module I have this code:

     

    Option Compare Database

    Dim strFilename As String

    strFilename = InputBox("File Name:", "Import To Access", "sampletext.txt")

     

    So why is it when I hit the green arrow in the VBA editor to run I get nothing in the list. I want importdata to be listed so I can run that module. What do I need to do?

    Tuesday, April 5, 2011 6:46 PM

Answers

  • you have define procedure in module body

    Public Sub MySub()
      Dim strFilename As String
    
      strFilename = InputBox("File Name:", "Import To Access",  "sampletext.txt")
    End Sub
    

    • Marked as answer by S.e.p.y Tuesday, April 5, 2011 7:08 PM
    Tuesday, April 5, 2011 6:48 PM

All replies

  • you have define procedure in module body

    Public Sub MySub()
      Dim strFilename As String
    
      strFilename = InputBox("File Name:", "Import To Access",  "sampletext.txt")
    End Sub
    

    • Marked as answer by S.e.p.y Tuesday, April 5, 2011 7:08 PM
    Tuesday, April 5, 2011 6:48 PM
  • Yes. You are spot on. Thank you.
    Tuesday, April 5, 2011 7:08 PM