Search results

  1. J

    Export SQL code to table.

    The code below exports the query name and the the first line only of the SQL code. Is there a way to export the FULL SQL code to a table, or text file? Sub ExportQueries() Dim db As Object Dim qdf As Object Dim rs As Recordset On Error Resume Next Set db = CurrentDb...
  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

    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...
  4. 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...
  5. J

    When "X" is not equal to "X"

    I have the following code snippet that refuses to do as it is bid. The idea is to catch an inadvertent "setfocus" to a control that already has focus. From the screenshots it is obvious that the control name and the string "str" are the same yet the "Then" clause is still activated. Private...
  6. J

    Followhyperlink alternate

    After having problems with followhyperlink I searched the net and found this site https://stackoverflow.com/questions/66698889/open-links-using-vba-without-followhyperlink. I installed the software and tried again with the same result, which is; In development mode, access 2016 64bit and w10...
  7. J

    Using a variable in sql query

    I have scanned the net and got so may different answers, that don't work, to this question' I am trying to replace the "From" clause with a variable in the code below. I keep getting an error in the from clause no matter what variations I try. Private Sub Command100_Click() Dim sTable As...
  8. J

    macro or function preventing saving date to a field.

    That title should read DATA, not DATE. I am getting this message after update on a combobox. There are no macros or functions in either the "afterupdate" or "gotfocus" events of the two controls involved. I have run the debugger a number of times and even changed the destination control from a...
  9. J

    Loss of formatting when copying forms in access 2016

    When making a copy of a form in access 2016, the back colour of all buttons is changed to a light grey while the back colour of labels and text remains unchanged. The property sheet of the buttons shows the original back colour highlighted. This happens when copying within a database or from on...
  10. J

    accde doing crazy things

    is there a way to track program flow in an accde file. When I run my software in debug mode it behaves as I want it. When I run it in accde mode it goes through the startup procedure twice. I have recompiled many times, without error but still get this same behaviour. I cannot post the full code...
  11. J

    findrecord finds partial input.

    How do I stop findrecord from returning a partial input? My search string is "505.1" findrecord returns a record containing "505.1DM". I cannot find a way to ensure it only returns a record with the exact search string. Is there a way around this or do I need to use a method other than findrecord?
  12. J

    MSOffice error message

    I am using this code to display images, Public Sub showPic(str As String) DoCmd.SetWarnings False Application.FollowHyperlink str DoCmd.SetWarnings True End Sub If the image is a JPG it displays in the default viewer without an error message If the image is a raw, .nef, image...
  13. J

    Add a table to a split database

    My database is split with front end, back end. How do I add a new table other than delete the links in the front end, copy the tables from the back end and then split again. Is there a way to add the new table without all that rigamarole. I am currently using the code below to re-link after a...
  14. J

    Another query query.

    I think I know the answer to this one but I'll ask it anyway. Is there a way to use a combobox.rowsource as the input to a query, rather than build a new query every time. To explain: My form is used with 6 different tables. That means 6 queries for a combobox and another 6 queries to reduce the...
  15. J

    Another query query.

    I have an append query that Access seems to think is not good enough. The one field, that is the main criteria, "Taxon.Family" does not get appended. Access keeps adding this field to the append list, causing an error with two fields being appended to one. How do I stop Access from causing this...
  16. J

    A query query

    I have a "Yes/No" field in a table and I want to count the "Yes's" with a query. I have three records as "yes" If I use "Count" and a criteria of "False or No" it returns null. If I use a criteria of "True or Yes" it returns the total records in the table. If I use "Sum" and a criteria of...
  17. J

    querydef with parameters

    I have a series of almost identical queries that I would like to put into a qdf with parameters. I have used these in the past but my knowledge of SQL is not up to the complexity of this . A variant of the query shown is used as input for a bevy of count queries. There is also a set of append...
  18. J

    subscript out of range

    I have an array with 3 elements. Using the code below, if I call getargs(Args, 4), the code runs through the "if /else/end if" section error free but returns "subscript out of range" when it encounters the "IIf() statement. Is this a peculiarity of arrays, that they don't like the iif()...
  19. J

    recordset positioning problem

    I have two tables that are used in multiple sub's, for different purposes, in the same module. I have tried using different "Dim rsx as", "rsx.close and "rsx = nothing" with "x" being different in each sub. Trouble is the ".move" in one instance is changing the position in all instances of the...
  20. J

    screen.previouscontrol problem.

    This sub is on a form to catch the previous control and works correctly if the control is a command button. If the control is a textbox "Ctl" holds the contents of the box as a string. Private Sub btnAbout_Click() Dim ctl As Control Set ctl = Screen.PreviousControl ' getHelp...
Top Bottom