Recent content by John Sh

  1. J

    Another SQL problem

    Thanks Docman. I always get tangled up with the single / double quote thing.
  2. J

    Another SQL problem

    In the code below, I am using an alias for the table name, Thank you Plog. That all works fine but I need to include the table name in the file "NoMatchTemp" using an expression. All my attempts, so far, have resulted in the literal expression being transfered, or [A], as in the code I get a...
  3. J

    SQL problem

    Thank you Plog. I wasn't aware of the alias thing but it certainly makes life easy My final code is below. sQry = "INSERT INTO NoMatch ( Family, Genus, Accession, Collector, CollNumber, tFamily )" & " " & _ "SELECT A.Family, A.Genus, A.AccessionNumber, A.Collector...
  4. J

    SQL problem

    I have used the query designer to create a query that achieves the desired result and then taken the SQL from that query, [CODE strSQL = ]INSERT INTO nomatch ( Family, Genus, Accession, Collector ) SELECT Main.Family, Main.Genus, Main.AccessionNumber, Main.Collector FROM (Main LEFT JOIN Taxon...
  5. J

    SQL problem

    If I don't bracket the first instance, I get a different error, so it works when bracketed. If I do bracket the second instance I get another error, so I get the correct string, "Barry Collier Collection.Family" With the code as shown. What I need to know is what, or where, is the missing operator?
  6. J

    SQL problem

    I have the following SQL string that has an error in the JOIN statement that I cannot fix. It's probably very simple but my SQL knowledge is insufficient to sort it out, try as I may. In this iteration, sTable = "Barry Collier Collection" sQry = "INSERT INTO NoMatch ( Family, Genus, Accession...
  7. J

    Expected =

    So easy. Thank you.
  8. J

    Expected =

    In the calling sub, printIt(), the line " doReport(me.name, "PDF", "Bay", True)" returns an error, "Expected =". I have tried renaming both subs, but continue to get the same error. The sub printIT() will reside in various forms that control reports. The sub doReports() is in a module and...
  9. J

    When "X" is not equal to "X"

    I stand corrected on that point, however <You can set focus on any control as long as it's not disabled.> and visible
  10. J

    When "X" is not equal to "X"

    If a control has focus and you try to setfocus to that control you will get an error. Majp insists on leaving out the "if activecontrol is not the same as new control then change the active control" This is my original code Private Sub isInFocus(str As String) If Me.ActiveControl.Name <> str...
  11. J

    When "X" is not equal to "X"

    I've changed the code to the following and it now works correctly, even with the same value in each combo. You certainly put me on the right track. Private Sub isInFocus(ByRef Ctl As Control) If ActiveControl.Name <> Ctl.Name Then Ctl.SetFocus End Sub John
  12. J

    When "X" is not equal to "X"

    Actually it only appears to work. It returns the contents of the control, not the name. So if I put 1 in each combo there is no change of focus. I tried adding .name to the controls but Access says "Type mismatch". John
  13. J

    When "X" is not equal to "X"

    Thank you. That does exactly what I want, although I did get trapped where there was no active control. I can't use it in a load event but it's fine in the body of the code. I think my original code was somehow unable to distinguish the difference between control.name and a string. Once again...
  14. J

    When "X" is not equal to "X"

    Au contraire. You have left out the comparison. Your code actually does nothing. The code, below from arnelgp mirrors my code but passes the new control instead of a string. Private Sub isInFocus(ByRef Ctl As Control) If Not (ActiveControl Is Ctl) Then Ctl.SetFocus End If End Sub Note the...
  15. J

    When "X" is not equal to "X"

    what I wrote is this, Private Sub isInFocus(str As String) If Me.ActiveControl.Name = str Then Exit Sub <<<<<<<<<<<<<<<<<< Else <<<<<<<<<<<<<<<< Me.Controls(str).SetFocus End If End Sub Not this Private Sub isInFocus(str As String) If Me.ActiveControl.Name...
Top Bottom