It seems like a pretty simple question, but I can't find the answer, or I'm not looking in the right area.
I have a form, it has a employee number the user fills in. I have a connection created to SQL 2005. I want to call that employee number which is EmpNumTxt so it part of my Select statement. So when a employyes number is put in, it displays the name of that person.
SELECT EmpName from EmpTable WHERE "the text box on my form" = EmpNumber.
If I understand you are asking for the proper naming syntax for the textfield you added to your form.
1) In the Script Editor position your cursor where you want the textfield object proper name.
2) Move the mouse pointer over the textfield on your form and hold down the ctrl key. The mouse pointer will turn to a "V" shape. Click the textfield object and it will paste the proper naming syntax where the cursor is positioned in the Script Editor.
If I misunderstood what you were conveying please explain further.
Thanks for the reply. I tried that, but it didn't work. Let me try to explain this better.
I have a form with a employee number on it. I have a table in SQL that holds employess name, number address, etc. So I need when a user enters employee number '55', the name Tom Jones will appear in another text box.
The way I would normally do this is..
WHERE [File] = @Numb
@Numb would equal that value in the employee number text box. How can I take that value in my employee number box and pass it to my SELECT statement. Thus retruning a emp name.
I found this, with no answer. But this is my problem as well.
I'm trying to connect to a SQL Server DB to automatically fill certain form fields. I can create the connection, but then I am presented with a screen to select the data collection method - either Table, Stored Procedure, or SQL Query. I choose Stored Proc, but when I try to proceed I get the following error:
Does anyone have a solution to Jim's question? I need to know how to create a variable for a user-entered field, and have that variable be used in a SQL Server 2005 query associated with other fields on the form. In my situation, I chose SQL Query rather than Stored Proc, but the answer should be the same for both methods.