Search results

  1. T

    Division gives whole numbers in VBA

    Hello Rowen, it seem that you force integer for the result. One thing to check: Make sure that you use slash, not backslash. 30/60 results in 0,5 30\60 results in 0 (you can try in the immediate window) HTH Thomas
  2. T

    Problem with InSelection property

    > I work on an Access Add-In that screens a DB and allows to open objects in design mode to fix problems. Because the user of my Add-In is a developer, working on a DB.
  3. T

    Problem with InSelection property

    ByteMyzer, thank you for your input. Unfortunately it does not help me. I want to open the form in design mode, select the control and hand over control to the user, so that he can inspect the control or make changes as he deems appropriate. So the user will close the form when done with it...
  4. T

    Problem with InSelection property

    Hello, I work on an Access Add-In that screens a DB and allows to open objects in design mode to fix problems. I would like to be able to open a form in design mode and select a specific control. I have code that does exactly that: DoCmd.OpenForm "MyForm", acDesign...
  5. T

    Multiplying value

    You are welcome. Good luck with your project.
  6. T

    Multiplying value

    Here an extract from the Access help: While the control has the focus, the Text property contains the text data currently in the control; the Value property contains the last saved data for the control. When you move the focus to another control, the control's data is updated, and the Value...
  7. T

    ODBC Connection to SQL Server from Access 2007

    Hello Noodle-Head, you can change OBDC links with VBA. Here some code Sub ReplaceInConnectionStrings(sOld As String, sNew As String) Dim db As DAO.Database Dim td As DAO.TableDef dim qd as DAO.QueryDef Set db = CurrentDb For Each td In db.TableDefs If td.Connect <> ""...
  8. T

    Complicated Query

    With Mid("01/10/08",3,2) you extract two characters starting with the third one what gives you "/1". Certainly not what you want. Please describe the error in more detail if this does not fix your problem. Thomas
  9. T

    Refresh data in Access

    Link the SQL table via an ODBC link. Then you can construct an UPDATE query by joining the local and the remote table on the Account. Let Access do the work your you. :) Thomas
  10. T

    Import with variable filename

    It would work for sure if you use VBA code instead of a macro. Check the VBA help on DoCmd.TransferText command. This would give you full control over the filename. For a start you could "save as..." your macro as a VBA module, what might work right away (I never tried something like...
  11. T

    Sequence problem

    I ruined the sequencing sub query when writing some air code further up (lost the alias). This should work as the RowSource: StrSql = "SELECT (Select Count(1) FROM qTemp AS A WHERE A.AccountCode <=qTemp.accountcode) AS Sequence, qTemp.* FROM qTemp;" Let me know if it does. Thomas
  12. T

    Sequence problem

    Hello Gareth, I am surprised that your code works that far StrSql = "SELECT sequence, accountcode, customername FROM TblCustomers" & _ "WHERE accountcode Like '*" & sText & "*' ORDER BY accountcode ;" should fail right away as I assume there is no field called sequence in TblCustomers. Have...
  13. T

    Sequence problem

    Hello Gareth, you might want to remove the "On Error Resume Next" from your code to get error messages. Yes, CurrentDb.QueryDefs("qTemp").SQL = StrSql fails if there in no qTemp query. It doesn't matter what is in it as it gets overwritten anyhow. Thomas
  14. T

    Sequence problem

    Hello Gareth, applying the sequence number should be the last step. Filter first with the user input: '--- define query with filter condition on the fly StrSql = "SELECT sequence, accountcode, customername FROM TblCustomers" & _ "WHERE accountcode Like '*" & sText & "*' ORDER BY accountcode...
  15. T

    Sequence problem

    Hello Gareth, you are doing the sequencing in qrycustomerselect, but that query is unaffected by the user selection. Move the sequencing to the SQL command you construct in the AfterUpdate event. HTH Thomas
  16. T

    Searching Multiple Fields

    WHERE clauses are evaluated left to right. That's why the AND is evaluated first and the result then ORed with the third condition. You can enforce an order of evaluation with parenthesis like this (I think that is what you want): WHERE [General Project Information].[Surrogate Rings] = -1 AND...
  17. T

    Using variables in 2007 macros

    Hello Peter, variables in a macro are difficult. I would recommend that you convert the macro to a module (supported by Access via Save As ... command) and solve your problem in VBA. HTH Thomas
  18. T

    Automatic deletion of backup 'database' file

    Should work. You could even automate the compacting with a Windows Scheduled Task that triggers an Access DB that does the job (maybe including a 'real' backup). There should be plenty of code snippets around the Intenet how to compact a (different) Access DB via VBA. Thomas
  19. T

    Sequence problem

    How do you apply the entered account code, via a filter? If so, I would assume that the SQL is not evaluated again, but just, well, filtered. Try to throw in a ListBox.Requery command in the code that does the filtering. If my assumption is wrong, please explain further how you do the...
  20. T

    add field from table to other table

    Update queries do things like that. Check the help on that term. Thomas
Back
Top Bottom