Search results

  1. ritchieroo

    Time conversion

    Use \ and Mod Public Function TimeFromSeconds(ByVal Seconds As Long) As String Dim hh As Long Dim mm As Integer Dim ss As Integer hh = Seconds \ 3600 Seconds = Seconds Mod 3600 mm = Seconds \ 60 ss = Seconds Mod 60 TimeFromSeconds = _ Format$(hh, "00") & ":" & _...
  2. ritchieroo

    delete table

    How about this? Public Sub DeleteTable(ByVal TableName As String) On Error Resume Next If Not IsError(DBEngine(0)(0).TableDefs(TableName)) Then _ DBEngine(0)(0).TableDefs.Delete TableName End Sub
  3. ritchieroo

    Help with NodeCheck event of Treeview Control

    I came up with this example, which works ok for me... Private Sub Form_Load() TreeView1.Checkboxes = True With TreeView1.Nodes .Add , , "n1", "n1" .Add "n1", tvwChild, "n1_1", "n1_1" .Add "n1", tvwChild, "n1_2", "n1_2" .Add "n1", tvwChild, "n1_3", "n1_3" .Add "n1_1"...
  4. ritchieroo

    spooky

    I've never come across this 'D' thing before, but it seems to be the same as 'E' (i.e. Exponentiation) I tried typing these into the immediate window... ? 3D4 30000 ? 3E4 30000 ? 3e-4 0.0003 The main problem is the IsNumeric function, which just determines whether a value can be...
  5. ritchieroo

    Can I rename the table from the vba code?

    Try this... DBEngine(0)(0).TableDefs("Table1").Name = "Table2"
  6. ritchieroo

    Recordset navigation.

    You can use the Move method on the recordset to move forward or backward a number of rows from your current position. You need to make sure that your current position is the first row: rs.MoveFirst rs.Move 13 You can move backwards by specifying negative values. You can use the...
  7. ritchieroo

    Default Quaters

    If you want to map the values 1, 2, 3, 4 ==> 2, 3, 4, 1 respectively, you can do this mathematically: y = (x Mod 4) + 1 (1 Mod 4) + 1 = 2 (2 Mod 4) + 1 = 3 (3 Mod 4) + 1 = 4 (4 Mod 4) + 1 = 1 This avoids using if/case logic and produces a faster function: Public Function...
  8. ritchieroo

    Like

    I seem to recall that 'Like' behaves differently depending on whether you are using DAO or ADO. In DAO you can use the access version, i.e Like 'Tom*', but in ADO you must use Like 'Tom%'. I could be wrong, but it's worth a try!
  9. ritchieroo

    What to use in place of COALESCE?

    Nz function Syntax: Nz(Value, [ValueIfNull]) (built-in function)
  10. ritchieroo

    Self Organisation

    I'm also pretty disorganised... my desk is a pile of scribbled notes, diagrams, and hieraglyphics I no longer understand. Here are my tips (some of which I may not actually follow): -- Stop making notes on scraps of paper... get yourself a large hrad-bound notebook (one per project), start...
  11. ritchieroo

    Trouble Making A DB

    Why this layout? You're going to have a struggle making the form look the way the company clerks want. Access works best if forms are as near to normalized as possible. I would push back... start by asking why this layout is particularly important? It may be a case that this layout may be an...
  12. ritchieroo

    TIP: Storing Images in Access

    Yes In fact the basic functions can be used to read/write any files to BLOBs in the database... could be bitmaps, jpegs, word documents etc. Because the files are BLOBs and not OLE objects they can't be launched directly. You need to write the file temporarily to the hard-drive before using...
  13. ritchieroo

    Dim dbs as Database

    Check your VBA references... ...you may need to add a reference to DAO
  14. ritchieroo

    Editing Menu Items

    You will need to use the "Microsoft Office [v.v] Object Library" to manipulate menus programatically. You can add/delete CommandBar objects from an existing menu or create entire menus from scratch. I'm sorry that I don't have a working example, but there are examples on the MSDN site.
  15. ritchieroo

    Encrypting SendObject

    Encryption Does your client have a preferred encryption method? You can design your own encryption method (some sort of hash as suggested) fairly easily if you know what you're doing, but this won't be very secure. If your client wants a high degree of security you may want to look at an...
  16. ritchieroo

    Editing Menu Items

    Custom Menus You need to start by adding a "Custom" menu. Right-click the menu bar and select customize to open the "Customize" dialog. Select the "Commands" tab, and then "Files" from the "Categories" listbox. Select "Custom" from the "Commands" list and drag this option onto your toolbar...
  17. ritchieroo

    sql query with parameters in a function

    Test your function on it's own... I can't see where you set the return value, i.e. sql_action_ajout = ???
  18. ritchieroo

    check if query returns empty.

    Use RecordCount property A RecordSets "RecordCount" property will be zero if there are no records, and will be non-zero if there are one or more records. (note: the actual value you get depends on the type of cursor used to open the RecordSet so don't rely on it necessarily be a total count)...
  19. ritchieroo

    Running a DB without spending £300

    Also... If they have MSOffice already they can buy the access upgrade for MSOffice rather than the full software for under £100
  20. ritchieroo

    Running a DB without spending £300

    If your users have Excel, it's possible to create an interface for an access database in Excel (I have seen it done)! A lot of places won't license Access, but will install Microsoft Office including Excel. The Jet Database engine, and hence the DAO object model are usually included in the...
Back
Top Bottom