Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...I love this site! It's so nice to know that there are so many people out there who are willing to share their knowledge..."

Geography

Where in the world do Tek-Tips members come from?
3535 (Programmer)
11 Jan 00 2:10
I have a line of SQL code that looks like:
If Me.Text2 <> "" Then
SQLStmt=SQLStmt& "(Table1.Terr = ' " & Me.Text2 & " ')"
Endif

Instead of getting the number from a Unbound field called Me.Text2, I want to get the Number from the answer received from an InputBox.

The line of code for the InputBox is:
Me.Filter = "Terr = " & InputBox("Get terr:", " Get Terr")

I need help on what to change in the SQL Code ?

DougP (MIS)
11 Jan 00 7:36
Here are the basics of concatentation
for numeric
SQLStmt = SQLStmt & me!Text2
if its a string
SQLStmt = SQLStmt & "'" & me!Text2 & "';"

when you first right code, keep it simple put each step on it's own line
Don't try to create to complex a statement in one line to make it run faster
this will allays cause you problems with syntax.
Here is an example
X= inputbox (somevalue)
Me!filter= "Terr " & X

Separate the items out and get them to work first then look at making your code more efficient.
On today's Screaming machines the time it takes to go through a few extra lines of code is miniscule
compared to troubleshooting a complex line.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close