Search results

  1. J

    Solved SQL problem

    I have a series of 5 boolean controls where any one of them being true will cause text in a control to change. I can't get the code to work without the first criteria being true. I have tried all manner of variations without success. Do I need to use a single sql statement for each boolean, or...
  2. J

    Solved searching with a partial string

    I have a situation where a number of entries have been mis-spelled and I need to find the correct spelling in a reference list. As an example, the mis-spelled word is "Dryopteriaceae" and the correct spelling is "Dryopteridaceae". My idea is to start with the full word and work backwards until a...
  3. J

    Closing image viewing software

    I am using the following code to open a picture viewer via vba oShell.NameSpace(0).ParseName(sPath).InvokeVerb "Open" Then this code to close the viewer Dim Exe As Object For Each Exe In GetObject("winmgmts:").ExecQuery("Select Name from Win32_Process Where Name = '" & sViewer & "'")...
  4. J

    Solved Conditional format problem

    Is it possible to format one control to be the same colour as another control such as control A = RGB() of control B so that control A is always the same colour as control B without having to write an expression in control A for each possible state of control B with the same colour in each'
  5. J

    Solved Variable not defined in sql string

    In the attached sql string, the alias "A" is not recognised at the first instance of "A.accession" "Accession" is a valid field in the table "Discrepancies". If I remove the alias and use the table name I get the same "variable not defined" error on "Discrepancies" I have tried enclosing table...
  6. J

    Solved Family not included in aggregate function

    I am in the process of converting sql strings to incorporate "select distinct" and also to use currentdb.execute where appropriate. As I understand it, "select distinct" eliminates the need for the "Group" clause. The following code seem to refute that. What am I doing wrong? I understand the...
  7. J

    Unable to delete record due to record lock

    I have a form that displays an image depending on the data input to two combo boxes. A small table is created with the image location info and multiple images can be scrolled through. This all works fine until the data is changed. Before adding new data to the table I am attempting to delete the...
  8. J

    Shell.application with second argument

    I am currently using this construct to open a word document to a bookmark/hyperlink, "Help" in this instance. FollowHyperlink TempVars!XLA & "The Don McNair Herbarium Data Set.docx", "Help", , True Is there a way to implement this with the "Shell.application", it doesn't accept the second...
  9. J

    MS Office warning

    I am using followhyperlink to open an 'NEF" image and get this message. If I select "cancel", I immediately get an error message indicating a null value. Turning warnings off has no effect and there seems to be no way to trap the null error except "on error resume next". Is there a way to avoid...
  10. J

    Double jeopardy

    I have two problems in the attached sample. 1. If I leave the recordsource statement un-commented, the code goes straight to the "Createdby_Gotfocus" event, runs it then returns to the onload event. Comment it out and the code runs as expected. 2. With the "on error resume next" statements...
  11. J

    Solved It needs a bracket

    This sql string tells me it expects ")". There must be one place I haven't tried and I have no idea where that place is. The problem is in the where clause and specifically after the "And", as I read it. The where clause was originally a "Having" clause but this seemed to be causing even more...
  12. J

    Record is deleted

    I have a simple table that acquires a few records during the operation of a module. After acquiring 4 or 5 records this table is read to indicate where action is required. My problem is that I am getting an error indicating the "record is deleted." Prior to running the module I delete all...
  13. J

    instr in a filter

    I have a list of names in a field "Collector" that can include the names of others in a team, .e.g. "Jones. K. Smith. W." I want to filter this field such that it will return all fields that include "Jones" . I have tried many variations of the code below but .filter always returns "False"...
  14. J

    Solved Variable in HAVING clause

    I know this is an old beast but none of my reading, or various attempts, has set me on the right path. In the code below sTable is passed in from the calling sub but is not recognised by the SQL statement. Replacing the variable with a string, "Collection" in this case causes the SQL to run. I...
  15. J

    me.visible = true is false

    I use .visible=true in most load events to control when the form becomes visible. This works well except for a couple of particular cases. If I run the software in develop mode or click the accde file all is good. If I run it from a shortcut with windows minimized then a couple of the...
  16. J

    Error "Can't set focus"

    In the code below, the sequence of events is as follows; Load event runs through all commands and set's focus to cboFamily. cboFamily gotfocus event does it's stuff. cboFamily_afterupdate runs and set's focus to cboGenus. cboGenus goes through to cboGenus.dropdown. If I'm stepping through, the...
  17. J

    Command button not responding to double click

    I have a series of command buttons, set up with the code below , to index a column ascending with a single click or descending with a double click. Using command buttons allows me to change the colour of the active button and enhance the form's appearance. Problem is the command buttons are...
  18. J

    count query.

    1) I need to isolate numbers where the integer value is different to the double value, I.e. 123 <> 123.1. 2) store the integer values in a table. 3) delete any numbers that occur more than once. I.e 123.1, 123.2,123.3 stored as 123, 123, 123 would be deleted. 4) The final table will be used in a...
  19. J

    FYI

    I've been a bit curious about the time taken for various ways of calling a sub / function where a particular form is involved. I've tested this over 10000000 iterations with the results below. In the first test I passed the form name as "Me" Private Sub timeTest() Dim nNum As Long...
  20. J

    Resize a control on a continuous form

    I have code, below, on a single form that resizes a control if the text is longer than the control width, when the control has focus. Is it possible to do the same thing on a continuous form? All I can do so far is highlight the entire column. Public Sub newSize(str As String) Dim cTop...
Back
Top Bottom