Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2004
    Posts
    10

    Unanswered: Prompting for values in VBA

    Is it possible to create a parameter prompt in VBA, like the prompt that comes up when you ask for a paramter value in a query [like this]? I tried

    strParameter = [Enter the value here]

    but it doesn't seem to like that. I also tried making a query that asks for the parameter and doing a dlookup on that query, but no luck there either.

    The code that needs this isn't part of a form, otherwise I'd make the user enter the values into text boxes.

    Any ideas?

  2. #2
    Join Date
    Apr 2003
    Location
    Alabama, USA
    Posts
    154
    Code:
    	myValue = InputBox("Enter Value", "My Inputbox")
    	MsgBox myValue
    The code above will prompt the user to enter a value and then a message box will display the value entered.

    How do you need to use the value that you want to promt the user for?

    Hope this helps!
    http://AccessDB.Info

    You live and learn. At any rate, you live. - Douglas Adams

  3. #3
    Join Date
    Jun 2004
    Posts
    10
    Thanks! This works great.

    I needed an alternative to asking for a parameter as a workaround to the problem I posted in a thread a ways back - see http://www.dbforums.com/t1005439.html . Though Access didn't like InputBox() placed in a query directly, it didn't care one bit when I created a "wrapper" function to allow InputBox to be called from a query. Not an idea solution, but it worked.

  4. #4
    Join Date
    Jun 2004
    Location
    Terrapin Nation
    Posts
    205
    Of course prompting the user isnt the best way. You should create a form with a combo box so you can limit what the user can put in as criteria.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •