rutgermons
asked on
macro input box
Folks
the below is code that allows me to input the exact sql query I want to parse in excel from my oracle db
strSQL = InputBox(Prompt:="Your required result set.", _
Title:="ENTER YOUR QUERY", Default:="Your Query here")
If strSQL = "Your query here" Or _
strSQL = vbNullString Then
however I want to hardcode the first part of the query and only want the where clause contained in the input box
i.e. "select * from tablename " is fixed and non editable, I do want the where clause to be editable so basically have it like so:
select * from tablename where + strSQL
strSQL = InputBox(Prompt:="Your where clause.", _
Title:="ENTER YOUR WHERECLAUSE", Default:="Your where clause here")
If strSQL = "Your where clause" Or _
strSQL = vbNullString Then
How do I do this?
cheers
the below is code that allows me to input the exact sql query I want to parse in excel from my oracle db
strSQL = InputBox(Prompt:="Your required result set.", _
Title:="ENTER YOUR QUERY", Default:="Your Query here")
If strSQL = "Your query here" Or _
strSQL = vbNullString Then
however I want to hardcode the first part of the query and only want the where clause contained in the input box
i.e. "select * from tablename " is fixed and non editable, I do want the where clause to be editable so basically have it like so:
select * from tablename where + strSQL
strSQL = InputBox(Prompt:="Your where clause.", _
Title:="ENTER YOUR WHERECLAUSE", Default:="Your where clause here")
If strSQL = "Your where clause" Or _
strSQL = vbNullString Then
How do I do this?
cheers
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
@MacroShadow
in your code strSql cannot be null, I've also corrected the test for the default value
pls try
Open in new window
Regards