Search results

  1. T

    Find Record

    It was only hard because you didn't know how to do it. I'd try and convince you to not use SELECT * in your production code/queries. It works for sure, but if you know you want "EmployeeName" from your table, SELECT it specifically. Other than reducing the amount of data that you retrieve from...
  2. T

    How long to build a database?

    How long is a piece of string? Depends on the requirements, how much code I've already written that can be reused, how many times the customer changes their mind and so on. I've spent 6 months working on a template reporting application for the place I'm at currently. Now that's written I can...
  3. T

    Find Record

    Yes, use a query. SELECT EmployeeNumber, FirstName, LastName, DeptNo FROM a table WHERE criteria = somevalue open that in a recordset, now you can do what you want with it: dim db as dao.database dim rs as dao.recordset set db = currentdb set rs = db.openrecordset("queryname or SQL...
  4. T

    Find Record

    I'd say yes, but it's difficult to expand on that answer much based on the information you've given.
  5. T

    Flower Show results tally

    Depends on the rest of the structure in some respects. tblPlacePoints might be appropriate PlacepointsID Points Place 1 5 1St 2 3 2nd 3 1 3rd 4 0.5 4th 5 0 Did not place Allocate...
  6. T

    Help with database design

    Yes it can, I'm trying not to fling massive amounts of changes at you until I get a better idea of what is going on (and you wrap your head around some of the changes). So, start to break down what it is that you actually need. So you have an Assessment. Each assessment has a "shopping list"...
  7. T

    Using excel as a backend? - A few Questions

    1) yes - create a linked table to the sheet. 2) Depends. I tend to create linked tables to spreadsheets to import data from them. I don't believe you can write data to a linked Excel spreadsheet and any alterations to the data(types) would need to be done in excel rather than Access. You also...
  8. T

    Help with database design

    Look at your existing structure, that a type of equipment might come from more than one supplier is catered for by your tblEqptSupplierJoin Table. it tells you that you can buy a Drill from B&Q or Dave's DIY. What it doesn't do is tell you that This Drill came from B&Q Is tblAsseEptJoin...
  9. T

    Extracting numbers from a string

    if it always that format you could use Split() ie dim strTest() as string -- note this is a string datatype, not a number (yet) strTest = split("2.5 to 5", " to ") You now have a two element array, the first contains "2.5" the second "5" as string values. If there is a chance that the...
  10. T

    update table from another table

    The line above is missing an & in the pasted sample.
  11. T

    Calculate time difference over days in hours

    Basic VBA to illustrate the method, the datediff() Function used like this can be done in both VBA and a query. Sub Test() Dim intHours As Integer Dim intMinutes As Integer intHours = DateDiff("h", #1/1/2012 12:30:00 PM#, #1/4/2012 2:45:00 PM#) intMinutes = DateDiff("n", #1/1/2012...
  12. T

    Help with database design

    Don't call all your PK/ID columns "ID" you'll tie yourself up in knots at some point trying to figure out which ID you're referring to. Call tblClient.ID ClientID (or Client_ID, ether is fine, just be consistent) as you've done as the foreign key and call the FK column the same as the PK column...
  13. T

    Exporting table contents into a .TXT file

    Glad it's sorted and thanks for letting us know.
  14. T

    When to create modules

    I'll also add that I like separation of function in my code. My forms don't talk to the database. They talk to classes that give or take the information from the form. Those classes in turn talk to a communication "layer" that process data and package it to and from the database. This is a...
  15. T

    When to create modules

    Agree on that as well :) If you have a procedure that runs for hundreds of lines, how many times do you repeat the same (or very similar) code? What about the next procedure down that also has areas of commonality? It's a judgement call as to whether you should break something out into a...
  16. T

    When to create modules

    No argument from me on that point. There are functions and functions :D I have one that creates an ADODB command object, I use that one a lot, it goes into the shared Functions modules. I have another that checks what version of Excel a user has, that one is in the Excel Export class.
  17. T

    When to create modules

    If you're interested in coding practices wider than just "making things work" I'd recommend getting your hands on "Code Complete" From Microsoft Press. It goes way beyond the scope of VBA and is essentially language agnostic (thought it does include samples of VB.net and Java code) but is a...
  18. T

    When to create modules

    I place all shared VBA functions in to a module called, funnily enough Functions. Functions that I call specifically from queries go into a module called SQL_functions. If I have a procedure/sub that is called from multiple places I'll create a module for that/them. I try to keep these to a...
  19. T

    data type mismatch in select query?

    The problem is the SQL string itself, the syntax and formatting on the first line around the instructor Full_name is wrong and the value from the combobox isn't formatted correctly.
  20. T

    IF statements to Open Forms (Access 2003)

    Depending on what me![application date] actually is: Private Sub Classes_List_Click() if me![application date] = "" Then 'assuming this is a text box, "" might not be a valid test. me![application date] = date end if DoCmd.RunCommand...
Back
Top Bottom