Search results

  1. E

    Docmd.RunSQL

    put single quotes around settled instead of double, e.g. 'settled'
  2. E

    "Include" Or "Import" VBA modules

    in the VBA editor, go to Tools>References, then browse...change the file filter to .mdb and select the db containing the module. It is for this reason that it is always good to change the VBA project name to something meaningful. Obviously the module has to be in database. HTH, Chris
  3. E

    Wildcards

    What else is in strWhere before you add: strWhere = strWhere & " ([Company] Like '" & Me.txtSearchCompany & "*')" because I set up a table and a form with variables named exactly as above and I get no error. I need to see the whole string. Comment out the Me.filter = strWhere and replace it...
  4. E

    Wildcards

    What error does it give? Have you put in a debug.print strWhere to see what the contents of string actually are? I can only help so much...
  5. E

    Wildcards

    hi, if you only want word beginning with then alter my code as follows: strWhere = strWhere & " ([Company] Like '" & Me.txtSearchCompany & "*')" (I just removed the first wildcard (*) so now if txtSearchCompany is Unity, then Unity Hospital, Unity Bridge and Unity Cakes would come up.) Is...
  6. E

    Wildcards

    if I have understood you right, try: strWhere = strWhere & " ([Company] Like '*" & Me.txtSearchCompany & "*')" if txtSearchcompany was Light, then the search would bring up companies called, Electric Light Company, Light Machines Ltd and SearchLight. HTH, Chris
  7. E

    Caption not updating

    Pop79, this would work as well: Case "CONNECT" ODBCStatus = 3 UpdateConnectionStatus DoEvents ConnectToData UpdateConnectionStatus HTH, Chris
  8. E

    Need help to open a web page through Macro

    Chaitanyat2001, the command Followhyperlink is peculiar to access, which is why it will not work in Visio. although all the Office applications use VBA, each has its own object model which means each has its own individual objects that are appropriate to the application. Even though some...
  9. E

    Find a Date & Time using GetFileTime

    use this structure: sub subname() on error goto err_handler ' err_handler is just a user-defined name, no set in stone ' code goes here exit_sub: exit sub err_handler: if err.number = [enter the errror number you get] then msgbox ""%file% could not be scanned, a log will be...
  10. E

    VBA to check if recordset is empty?

    hi Paul, In the Form that you are opening put: Private Sub Form_Open(Cancel As Integer) If Me.Recordset.RecordCount = 0 Then Cancel = True End If End Sub then open the form like normal in the on_click of the command button. HTH, Chris
  11. E

    How to check each tbl for a date, then archive all data older than a month?

    RaggaJunglist, the reason I used cdbl(yourdate), is so that you do not run into date conversion problems. Using #30/04/08# is easy to handle, as Access makes an educated guess but if you are in UK and put #05/04/2008#, The DAO SQL will take that as 4th April 2008 not 5th May 2008. Do as I did...
  12. E

    How to check each tbl for a date, then archive all data older than a month?

    hi, create a procedure in a module: function ArchiveTables() Dim tdf As DAO.TableDef Dim db As DAO.Database Dim fld As DAO.Field Dim yourdate As Date Dim lErr As Long yourdate = DateAdd("m", -1, Date) ' one month ago Set db = CurrentDb For Each tdf In...
  13. E

    Automate checkbox using VB

    in the onClick procedure for the button, put: chkYourCheckBox.value = true obviously, subsititute chkYourCheckBox with the actual checkbox name in your db. HTH, Chris
  14. E

    How to check each tbl for a date, then archive all data older than a month?

    Could you be a bit clearer? When you say auto-archive, how are you going about it? I assume that you want to move any records older than a certain date to in a table to an archive version of the table. Also, did you define "last modified date" fields for each table to help you work out which...
  15. E

    Acces and Excel Help

    try: n = 2 temp01 = xlSheet.Range("F" & n).Value temp02 = xlSheet.Range("B" & n).Value 'if IFF_description is a numeric field temp01 = dlookup("IFF_name", "IFF_Descriptions","IFF_description =" & temp02) ' if IFF_description is a text field temp01 = dlookup("IFF_name"...
  16. E

    Table description

    I've never managed to get an proper official explanation as to why you need to use: dim db as database set db = currentDB It seems to be rule that CurrentDB is good only for the line it is on. After that, it loses its connection to the underlying DB. Chris
  17. E

    Table description

    That was why I said "Interestingly, you can get to the table description like this as well". I figured you would realise that the code I posted works for Forms, too. Chris
  18. E

    Possible to use DMAX with SQL Insert??

    I'm sure there must be a single SQL statement - all be it complicated - that can do this. However, you need a solution and I think I have one which should not be too slow: set rs = db.openrecordset("SELECT operation_num, op_type, op_description, emp_id, est_mins " & _ "FROM...
  19. E

    Table description

    Interestingly, you can get to the table description like this as well: db.Containers("Tables").Documents("YourTable").Properties("description") Oddly, if the description is blank, then Access will tell you that this property does not exist, but as soon as you give it a description, you can...
  20. E

    Possible to use DMAX with SQL Insert??

    Looking back at your insert statement, does the SELECT part of the statement return more than 1 record? If it returns multiple records, could you give me a small amount of data jsut to help me grasp what is going on? I'm nearly ther but not quite. I'm on these lines - correct me if i'm wrong...
Back
Top Bottom