Search results

  1. J

    Update query doesn't like value formatted for a different region.

    SQL is correct now. If 4,25 ist shown in table, this is also correct, because, is the decimal separator. String * Numeric = ? => implicit conversion (with decimal comma in Windows settings): CDbl("4.25") * 1 = 425 * 1 = 425 CDbl("4,25") * 1 = 4.25 * 1 = 4.25 Str(..) is to convert a number into...
  2. J

    Update query doesn't like value formatted for a different region.

    .. Because you use a decimal point instead of a decimal comma in Windows settings. If , is set as decimal separator in Windows: Dim strSQL as String dim dblODJobRate as double dblODJobRate = 4.25 strSql = "UPDATE [Order Details] SET ODJobRate = " & dblODJobRate Debug.Print strSql ' => Output...
  3. J

    RunTime error 2471 with DLOOKUP

    @The_Doc_Man: deprecated in VB.NET. ;)
  4. J

    RunTime error 2471 with DLOOKUP

    Do I understand you correctly: This text "Text, Text, Text" " & vbNewLine & vbNewLine & "Text" can be read exactly like this in the text field of the table? Then it is also displayed in exactly the same way in the message text. vbNewLine is then just a text. Why is it stored like this? The text...
  5. J

    Update query doesn't like value formatted for a different region.

    Maybe this description will help: https://codekabinett.com/rdumps.php?Lang=2&targetDoc=vba-sql-string-tutorial /edit: Perhaps a look at the example application Northwind 2 will also help. In NW2, the StringFormatSQL function is responsible for converting values into SQL text.
  6. J

    Compile error again

    Tip: First create an SQL statement in a single string. Then add the variable values from VBA. Then you can immediately see which change raise a syntax error. First the cumbersome version: 1. strAppSQL = "INSERT INTO SalesTransactionItemsTB ([ItemPurchased],[ItemQTYpurchased],[RetailitemPrice])...
  7. J

    Update query doesn't like value formatted for a different region.

    Use Str(...) SqlText = "UPDATE [Order Details] SET ODHaulageRate = " & CStr(1.2345) & " Where ..." Debug.Print SqlText ' => 1,2345 SqlText = "UPDATE [Order Details] SET ODHaulageRate = " & Str(1.2345) & " Where ..." Debug.Print SqlText ' => 1.2345 BTW: @MajP: one minor fix in CSql: remove C...
  8. J

    Problem with Search Boxes

    [OT] However, you can also set the Form.Filter property, as this forwards the criteria to the SQL Server in the same way and only the requested data is transferred. The statement that all data records are retrieved from the server and only then filtered in Access cannot be confirmed in the SQL...
  9. J

    A dream: What I do miss about Access.

    They did not develop the add-in any further. The Access object options are still available. However, the locks don't fit distributed VCS, so I hope they don't reuse that with the Git integration.
  10. J

    control variable

    I have another example of entering a calculation in a TextBox control with a helper class. Code in form: Private m_CalcTextBox As CalculationTextBox Private Sub tbQty_GotFocus() Set m_CalcTextBox = CalculationTextBox(Me.tbQty) End Sub Private Sub tbQty_LostFocus() Set m_CalcTextBox =...
  11. J

    Glitch in Replace function / Object Browser documentation

    Correct would be (online documentation + behavior in VBA): Function Replace(Expression As String, Find As String, Replace As String, [Start As Long = 1], [Count As Long = -1], _ [Compare As VbCompareMethod = vbUseCompareOption]) As String vbUseCompareOption = -1 ... this value...
  12. J

    Glitch in Replace function / Object Browser documentation

    Replace without compare parameter depends on the “Option Compare” setting. Option Compare Database ' OR Text Option Explicit Private Sub Test() Debug.Print Replace("A", "a", "x") = "x" End Sub vs. Option Compare Binary Option Explicit Private Sub Test() Debug.Print Replace("A", "a"...
  13. J

    Solved Weird Visual Bug in my Code that Conditionally Hides Columns

    Is HorizontalAnchor possibly set to the right?
  14. J

    A dream: What I do miss about Access.

    It's time to update the VBA editor. In principle, Microsoft already has a suitable basis: the Monaco Editor. However, my hope that Microsoft will come up with optimizations for the VBA editor is close to zero. I have more hope for the project by Wayne Phillips (for me the real "master of...
  15. J

    RunTime error 2471 with DLOOKUP

    StrValue = DLookup("[English]","LanguageTable","[German]=German") Except for Null in the data field German, the criteria German=German will be true for every record. ;)
  16. J

    Solved Need help with before update code logic?

    Is it bad if the test is carried out twice? Private Sub CancelBtn_Click() If Me.Dirty Then Me.Undo End If DoCmd.Close acForm, Me.Name End Sub Private Sub CloseBtn_Click() If Me.Dirty Then If Not IsValidData Then Exit Sub End If End If DoCmd.Close...
  17. J

    OpenQuery and TransferSpreadsheet?

    Perhaps the variant via ADODB runs faster. Tested with Northwind 2: 29 tables .. export time: ~1 sec Private Sub ExportTablesToExcelWithADODB() Dim ExcelFile As String Dim ConnectionString As String Dim cnn As ADODB.Connection Dim InsertIntoSql As String ExcelFile =...
  18. J

    Inserting Dates

    1 / 2026 = 4.93583415597236E-04 ;) Dim NewDateFrom as Date NewDateFrom = DateSerial([txtY], 1, 1) Dim strSQL As String strSQL = "UPDATE tblCurentPastYears SET DateFrom = " & Format(NewDateFrom, "\#mm\/dd\/yyyy\#") & _ " WHERE DateFrom is Null;"
  19. J

    SSMA - Issue with Boolean Access Fields

    A side note: If nobody cared about the numeric value of True in Access queries and simply wrote True, queries on SQL Server tables linked via ODBC would also work. Select ... From LinkedServerTable where BitDataField = True This ensures that a Boolean/Bit data type is transmitted instead of a...
  20. J

    MS ACCESS connect to SQL server BE: Authentication Prompt every time I attempt to

    [Slightly off topic] Note: The sa password is saved directly in the application or unlocked with it ... the cracker's heart laughs. ;) Windows authentication is not wanted?
Back
Top Bottom