Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. TTThio

    Recordcount returns -1 even after MoveLast

    Thank you for the reply. There's nothing wrong with the Select Unique statement. And I've also tried movelast, movefirst. It still returns -1. However, I've found another way to return the total record by using Do...Loop Until, MoveNext, and then saving the total = total + 1 until rst.EOF...
  2. TTThio

    Recordcount returns -1 even after MoveLast

    I'm using CreateWorkspace and OpenConnection to go directly to the data source (ODBC). I guess it's not an ADO nor DAO. Thanks though.
  3. TTThio

    Recordcount returns -1 even after MoveLast

    I'm taking the data from ODBC used in Excel. The one makes me confused is, I'm setting a criteria for the data pulled, exp. if Name = A, Name = B, etc. When it goes to Name = A, the rst.recordcount does return a number ( = 5), also for B ( = 15). But only when Name = E, the rst.recordcount...
  4. TTThio

    Recordcount returns -1 even after MoveLast

    Hi all, I just did a Select Unique to return a recordset. I'm using rst.movelast then rst.recordcount to return the total records. It keeps giving me -1 instead of the real number. I know it's not much , only 100, so how come it didn't work as it's supposed to be? Thanks ahead, Tin Tin
  5. TTThio

    How can I use a form to create a string & populate a field in a table?

    Hi, I thought previously you said you've been able to create the string already, that's why I just mentioned the control source part. Well, basically this is the whole process that I've tried and worked just fine. For example: In the form that have TableA as record source, you have bound...
  6. TTThio

    Assign a select query value to a form textbox

    I'm using '!' instead of '.' I've tried and it did work. Did you at your query if there's a result in the LineTotal field?
  7. TTThio

    How can I use a form to create a string & populate a field in a table?

    FileName needs to be the Control Source of Create_FileName. So whatever read in the Create_FileName will be what in the FileName.
  8. TTThio

    Assign a select query value to a form textbox

    In the textbox 'Control Source' property, type: =[Query]![Field] It should work. Good luck.
  9. TTThio

    Joining Tables

    You can use LEFT JOIN in the SQL statement. After making a query in the design view by combining 2 tables, go to View, SQL View. Change the word "INNER" in the statement to "LEFT". That way, it will display all data in the left table and the matching data in the right table...
  10. TTThio

    Change a Query's Criteria with code

    In the design view &quot;Criteria&quot; just type: >=[Forms]![FormName]![StartDate] And <=[Forms]![FormName]![EndDate] It means, it will query data that starts in StartDate and ends in the EndDate. Good luck.
  11. TTThio

    Excel range selection problem

    Let me experiment with it. I'll reply to you later on. About 'Selection', you don't need to set a variable for it. It's a built-in.
  12. TTThio

    Can you use code to make a table?

    Hi Nicky, yes, you can use VBA to do 'Make Table Query'. Use &quot;SELECT fields INTO new table FROM source WHERE criteria&quot;. Take a look at your built-in make-table query, go to VIEW - SQL. That's how you create a SQL statement in module. You just have to add the WHERE criteria if you...
  13. TTThio

    Excel range selection problem

    Hi, I tried to write just: ActiveSheet.Range(&quot;A&quot; & X + 1 & &quot;:&quot; & &quot;F&quot; & X + 1).Select and the rest It does work fine. So, I guess the problem is the var 'objNewXLBook' has not been declared/set yet. Tin Tin
  14. TTThio

    DCount on Yes/No Fields

    Here it is: x = DCount(&quot;[Field1]&quot;, &quot;Table1&quot;, &quot;[Field1] = Yes&quot;) y = DCount(&quot;[Field1]&quot;, &quot;Table1&quot;, &quot;[Field1] = No&quot;) Good luck, Tin Tin
  15. TTThio

    How to query database based on a list values?

    Hi, I need help to built a query based on a list. I have 2 worksheets, the first one contains some list of datas. The second one will be populated with data from database which is not in the first worksheet. I tried to create both queries directly in the code, such as query data where...
  16. TTThio

    Missing Right Parenthesis???

    Actually, we'll need one more parentheses to close it, or delete one from the first WHERE clause. This error actually reminds me that whenever I run a query that takes quite a long time, I always got a &quot;Execution failed&quot; message. Is this actually a problem with the time set up? I'm...
  17. TTThio

    Missing Right Parenthesis???

    I tried, now I got a message &quot; 3669 exection failed&quot; What is wrong now?
  18. TTThio

    Missing Right Parenthesis???

    Hi all, I've been overwhelmed with this for 2 days, still cannot find what is missing. Perhaps you can help me with this. I'm using pass-through SQl to take data directly from Oracle DB. Here's the result from debug.print vSQL: [b]SELECT Name, Account_ID, Account_Team...
  19. TTThio

    Concatenation

    Well, I think the problem is the SQL language for Oracle is not the same as for Access. So, I just substitute the 'Mid' with 'SUBSTR' and it works.
  20. TTThio

    Concatenation

    Okay, I'm taking the data from the oracle, and here's the complete syntax: vSQL = &quot;SELECT Count(Account) AS TotalCount FROM TB_OPTY_V Where (Sales_Team = '&quot; & iName(i) & &quot;') AND (mid(Sales_Stage,1,1)= '&quot; & i & &quot;')&quot; If I dismiss the second criteria, it works fine...

Part and Inventory Search

Back
Top