I changed the ChangeCustomerStatus Sub like this to get it to work on German machines - otherwise it will the Error 3061:
DetailsPrivate Sub ChangeCustomerStatus(CustomerID As Long, IsActive As Boolean) Dim S As String
' Execute ben'tigt die Werte in Englischer Sprache, Access konvertiert im Hintergrund aber nach Deutsch. ' Daher wird IsActiveEN explizit in englischer Sprache erzeugt und dann verwendet. Dim IsActiveEN As String IsActiveEN = IIf(IsActive, "True", "False")
S = "UPDATE CustomerT SET IsActive = " & IsActiveEN & " WHERE CustomerID = " & CustomerID
What did I have as the original code? I'm assuming the German words for TRUE and FALSE are different and that's what's causing the problem. As I've said a million times, I have ZERO experience with foreign language versions.
Sebastian RespondekOP
@Reply 2 years ago
Yes, it was that Access translated TRUE and FALSE in the background, when the String S was created
(So it was an invisible translation and though more annoying than helpful - especially because hardly anybody using a computer needs those words to be in german).
CurrentDb.Execute could not handle the String with the german words in it. Therefore, exept the comment, the three lines are slightly modified to get around that problem:
Dim IsActiveEN As String
IsActiveEN = IIf(IsActive, "True", "False")
S = "UPDATE CustomerT SET IsActive = " & IsActiveEN & " WHERE CustomerID = " & CustomerID
Maybe that helps somebody, I thought it was worth sharing it
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Access Developer 16.