Search results

  1. T

    Cross Tab Query doesn't recognise textbox value as valid field name or expression

    Good afternoon, In the attached test planner, I created a crosstab query. I wanted the query to return the results from a range of dates from 2 textboxes located in the Main Menu Form. In the criteria for the crosstab query, I placed the following: Between [Forms]![Main...
  2. T

    Iterating through dates in a For loop

    Will there be any issues with exit sub with regards to the releasing of recordsets, variable, memory etc.
  3. T

    Iterating through dates in a For loop

    i just learnt about EXIT SUB today. is it a good idea to use exit sub rather than nesting the code in the THEN block? especially, if there are many conditions i need to check before proceeding with the code. For example: SUB button_click() If condition1 THEN EXIT SUB END IF If...
  4. T

    How to check if a recordset is empty (or get the count of records) and to get summary values (e.g. max, min, avg)

    Hi, How do I check the following in a recordset (which is from a query, not a table): 1) if it is empty 2) number of records inside it (if i open the recordset with dbOpenDynaset) 3) max, min, avg I get a type mismatch error if I try the following to get the max: Dim myR As Recordset...
  5. T

    Using VBA to call a Query which takes a parameter from a textbox

    so i have to put the fDAOgenericRst() code in a code module, and then call it (change the line as you mentioned in your earlier post) instead of OpenRecordSet, right? Thanks!
  6. T

    Using VBA to call a Query which takes a parameter from a textbox

    i didn't. seems like a lot of lines and i don't really understand what is happening.
  7. T

    Using VBA to call a Query which takes a parameter from a textbox

    thanks! can you briefly explain why the code has to be changed to this in order for it to work?
  8. T

    Using VBA to call a Query which takes a parameter from a textbox

    the SQL for the query is as follows: SELECT Analyst_Availability.Work_Date, Analyst_Availability.Analyst_ID, Analyst_Details.Analyst_Name, Analyst_Availability.Available_Duration, Nz(Sum([Task_Detail_Table]![Duration_per_Qty]*[Task_Detail_Table]![Qty]),0) AS Time_used...
  9. T

    Using VBA to call a Query which takes a parameter from a textbox

    Yes, it has a criteria pointing to a textbox, txtAutoAssignDate. Hence, the following line of code (extracted from above): Me.txtAutoAssignDate = myR![Task_Detail_Date] Set myS = CurrentDb.OpenRecordset("intQuery_for_Analyst_Time_Used") In the above 2 lines, I'm trying to update...
  10. T

    Iterating through dates in a For loop

    Thanks for letting me know about the ZLS issue. How do I use LEN() to test?
  11. T

    Using VBA to call a Query which takes a parameter from a textbox

    Hi, I'm trying to stretch my VBA skills. So I wrote the following code; My first query is intQuery_for_AutoAssignment which returns a table of tasks to be assigned. Fields include the date, analyst_ID and duration. My first loop runs through each record from the about query in a recordset...
  12. T

    How to return zero in a field if it is null

    that's a nifty of acheiving pt 2. i learn a new function today. Thanks!
  13. T

    How to return zero in a field if it is null

    hi, the sample file is attached to my original post.
  14. T

    How to return zero in a field if it is null

    Hi, Test planner file is attached. So there are these 3 tables of interest in the database. Availability which lists the dates, analyst ID and the number of mins they have available. e.g. Date / Analyst_ID / availability 1 Feb 2022 / 1 / 400 1 Feb 2022 / 2 / 400 2 Feb 2022 / 1/ 400 2 Feb 2022...
  15. T

    Iterating through dates in a For loop

    thanks!
  16. T

    Iterating through dates in a For loop

    How do I prevent the For Loop from running if any of the needed controls are blank/null? I tried using a IF THEN statement with a End Sub inside it to end the routine early but got an error message.
  17. T

    Iterating through dates in a For loop

    Dear June, I will take note about the CODE tags. I didn't know about it prior to this. I agree with you that the message boxes are not neccessary. They are a relic of when I was just starting out with VBA and practising a few lines of simple code. They will most probably be removed in the...
  18. T

    Iterating through dates in a For loop

    Dear Pat, Thanks for explaining the difference between the + and the & operator. I learnt a lot!
  19. T

    Iterating through dates in a For loop

    Hi, I have a Form with the following: comboBox that allows the user to select their choice of Analyst - cboAvGenAnalyst 2 textboxes that allows the user to select the start and end date - txtAvGenFromDate & txtAvGenTillDate a textbox that allows the user to enter the duration in minutes -...
  20. T

    Solved Subscript Out of Range error when importing back tables

    Update: I managed to import the problematic tables via the csv route instead. Looking at the csv files vs the excel, it seems like the date fields were exported in "d/m/yyyy" but access requires "d/m/yyyy h:mm:ss" in order to import, text qualifiers (") were somehow missing for text fields...
Back
Top Bottom