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 Mike Lewis 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. ice051505

    How to delete all records in crosstab query before next loop

    Hi dear all, I have a piece of code about export different queries into multiple worksheet in one excel file. The query "DivideGroup" is a crosstab query, and the data value in "DivideGroup" should change in each loop depending on the grouping factors. Now I can get my first loop right, but the...
  2. ice051505

    how to move to the next recordset and clean up the previous query by VBA

    Sorry, here is the code...not familiar with the forums...lol Private Sub ExprDetail_Click() Dim db As DAO.Database Dim qdf1 As DAO.QueryDef Dim qdf2 As DAO.QueryDef Dim rst As Recordset Dim recordCnt As Integer Dim recordNm As Integer Dim sql As String Dim arrStr As String Dim arrCount() As...
  3. ice051505

    how to move to the next recordset and clean up the previous query by VBA

    Hi dear all, I have piece of code which is about to export different query into multiple worksheets in one excel file. Queries are made from distinct value of one recordset, I cam get the first loop successfully, but when it move to the second recordset, the result I got is the sum of two...
  4. ice051505

    IIf Function with multiple Conditions

    Hi all, I have a query with 5 field, [Country],[Province],[GroupingInfo],[City],[Area] I want to write or build a new query to have something on the [City] critiria like: IIf [City]="NoInfo" And [GroupingInfo]<=1 Then [City]=[Province], else [City] = [City] This is on the Query Sql, not on...
  5. ice051505

    Using array in VBA for store the queries

    Hi, sorry for the confuse, what I acturely mean is, Can anyone tell me how to write code to built a loop? Since I think I will need to develop a array for check each column, start from column4 to column 6. I think the loop may be like: With rst .MoveLast .MoveFirst If...
  6. ice051505

    Using array in VBA for store the queries

    hahaha, Sorry I am new to the VBA programming, so I just want a store sql or query in VBA by sort of array thing, instead of create a bench of query in my database, since the initial query size is undefined (base on the selection). So I intend to creat first sql on VBA, and I will use my code to...
  7. ice051505

    Using array in VBA for store the queries

    Hi All, I am working on write Sql in VBA and I want to save this query into a array table. Since I will change my Sql later,so the array size can not be defined now. I haven't done any code with array before, can anyone give me some example or hints on how to do that? Thanks! So an example of...
  8. ice051505

    I have a multi select list box call

    Now I get another error, Run-time error'3075': Syntax error(missing operator) in query expression 'Species IN(' Again, here is my code Private Sub Spc_Slc_AfterUpdate() Dim dbs As DAO.Database Dim rs As DAO.Recordset Dim strSQL As String Set dbs = CurrentDb strSQL = "SELECT SpeciesRef, Species...
  9. ice051505

    I have a multi select list box call

    Private Sub Spc_Slc_AfterUpdate() Dim dbs As DAO.Database Dim rs As DAO.Recordset Dim strSQL As String strSQL = "SELECT SpeciesRef, Species FROM Species WHERE Species IN (" & strCriteria & ") ORDER BY Species" Debug.Print strSQL Set rs = dbs.OpenRecordset(strSQL) <== this line gives error...
  10. ice051505

    I have a multi select list box call

    I tried this code but it gives my the error: object variable or with block variable not set. Can you help me to fix it?
  11. ice051505

    I have a multi select list box call

    I have a multi select list box called "Spc_Slc" and want to pass the selected value as criteria to the field called "Species" in my query. I don't know how to connect the code to my query without click command button, because I only want to use the query as data source to my other form. I have...

Part and Inventory Search

Back
Top