Search results

  1. C

    SQL - Append Query

    Thanks Plog - Worked a treat Cheers Dave
  2. C

    SQL - Append Query

    Hi All I have a master dataset which has approx 8500 patient records and have just inheritted another, similar dataset with approx 2500 patient records, many of which are duplicated. As part of this inherited dataset I have a table of test results some of which exist in the master dataset...
  3. C

    SubForm Sort Order

    Hi All I am having an issue with the sort order on a subform. Basically I have a main form with Client Details and a subform hich displays the associated test results for this client. Each client can have multiple test results which should be displayed in date order. Initially the form...
  4. C

    DLookup missing first record

    Regrettably I have to admit the common sense did get the better of me so I have replaced the table with an SQL statement as discussed and gone through and renamed all tables, fields, queries, forms etc. etc.. Its been a slow morning! Thanks All Dave
  5. C

    DLookup missing first record

    Thanks Namliam. I usually do but this is an inheritted database that I am just tweaking to a bit so not worth the effort of renaiming tables and fields. Cheers Dave
  6. C

    DLookup missing first record

    Thanks again Spikepl It doesn't matter what order the table is in as long as the code pulls all of the admin e-mail addresses. Surely by ensuring the loop starts at the first record (.MoveLast - .MoveFirst) and then moving to the next record in a loop will pick up all of the matching records...
  7. C

    DLookup missing first record

    Thanks Spikepl Revised code below for the benefit of other numbskulls like me. Note to self "Just because tables are shown in order it doesn't mean they are!" Dim rs As Recordset Dim strTblName As String ' ***** Open LogIn table as recordset ***** strTblName =...
  8. C

    DLookup missing first record

    Hi All I am having an issue with DLookup, which, for some reason which I do not understand appears to missing the first record in the table. What I am trying to do is to extract the e-mail address of all users who have 'Admin' status to the database. In the table ('LogIn') there are 3 users...
  9. C

    Interactive Query

    Hi Namliam I have to admit much of what I do doesn't make sense to me either! But in this case the -6 is used to determine how many fields there are to be imported and the +5 then sets the offset so that it starts importing from field 5. As for the query - I am in complete agreement and...
  10. C

    Statement Woes

    Seems like a fairly simple case of consecutive If statements, i.e. If this is true then Do this End If If that is true then Do that End If etc. Hope this helps Dave
  11. C

    Interactive Query

    Thanks Namliam, I knew the Gurus would come through. Based on the previous code try this. Private Sub btnMonthlyImport_Click() On Error GoTo Err_btnMonthlyImport_Click FieldCount = CurrentDb.TableDefs("lnkDEDMonthlyImport").Fields.Count ImportFields = FieldCount - 6 For i...
  12. C

    Interactive Query

    I'm sure there will be but it will take a bit more looking into - I'll have a look at it tomorrow if I get the chance.
  13. C

    Interactive Query

    It doesn't start at Column 1 the loop is looking up the DED columns, i.e. i=1 then fieldname is 'DED1', i=2 then 'DED2' etc. Obviously this assumes that each of the columns in the spreadsheet that you want to read are labelled 'DED1', 'DED2', 'DED3' etc. so it will only read the 'DED' columns...
  14. C

    Interactive Query

    Hi Ricchol65 If you are running your import by clicking on a button on a form then the following code should work fine. You will need to set up a linked Excel spreadsheet (I've called this DEDMonthlyImport.xls with the corresponding link in Access call lnkDEDMonthlyImport) and overwrite the...
  15. C

    Hash Deleted and autoincrement by 2

    I guess it is hard coded into Access to eliminate unique identifier violations. So you either have to remove the unique identifier requirement or find another way of creating a duplicate record without the unique identifier.
  16. C

    Hash Deleted and autoincrement by 2

    Your issue is with the Unique field. When you copy and Paste a record you will violate the unique field constraint so Access will delete the newly created record. There is no way around this using copy and paste. You probably need to create a query / SQL (APPEND) to copy the all of the...
  17. C

    Searching Table

    No because your query criteria will restrict the records returned to 'MSc'. You can set up the criteria so that you will be prompted to enter the query criteria each time you run the query so you dont need to have a separate query for each qualification. Alternatively you could select it in a...
  18. C

    Searching Table

    Hence the need for two tables, that way you are only searching one field for the qualification 'MSc' for example. Otherwise you will potentially have to have 18 qualification fields in your single table which you will need to search through. Running a simple query across your linked tables...
  19. C

    Searching Table

    Surely you would be better having two tables - User Table with your user information and qualifications table with details of their qualifications, linked by User ID, so for each user record there could be multiple qualification records. Hope this helps Dave
  20. C

    Form 'OnCurrent' Event not firing properly, but does when stepping through it??

    Highlight the variable and Pres Shift F9. Presumably you know what the variables should be so you can see if they are being evaluated correctly in the Watch window (usually at the bottom of the VBA window). I guess the key values to watch are: Me.Net Forms!orderentry![tblAllocation...
Top Bottom