Search results

  1. KP_SoCal

    VBC to change Query Properties for multiple queries

    Below is a simple block of code that allows you to change the "ODBC Connect Str" property for a specific query to the desired connection string. Dim db As DAO.Database Dim qdf As DAO.QueryDef Set db = CurrentDb Set qdf = db.QueryDefs("Query Name") ' Change the connect string: qdf.Connect =...
  2. KP_SoCal

    DCount Function in Macro Condition

    The expression below fires an action when "There are more than 35 entries in the OrderID field of the Orders table." DCount("[OrderID]", "Orders")>35 I'm looking for a condition that would fire when "There are more than 35 entries in OrderID field that are NUll for the Orders table." Any...
  3. KP_SoCal

    VBA to update values in one table based on another table

    Calling any VBA genius! Here’s what I’m trying to do. I attached an excel document that ties in with my question. In Query1, I pull my raw data to create Table1. I need Query2 to evaluate the fields in each row of Table1 that match the Master Table and clear the fields (or set to Null)...
  4. KP_SoCal

    Update all Null Fields to a specific number using VBA

    Hi all. I'm looking for a block of code that will update all null fields in a table to a specific number such as 9999 for instance. Under normal circumstances I would just create an update query with several iif statements to accommodate this. Or I could create a table that has each field...
  5. KP_SoCal

    Do not import data if table already exists

    I run the following code to import a table from another database into my current database. DoCmd.TransferDatabase acImport, "Microsoft Access", _ "C:\MyDocs\AnotherDatabase.mdb", acTable, "AnotherTable2009", “CurrentTable2009” If CurrentTable2009 already exists in my current database, I do...
  6. KP_SoCal

    Export existing table into another database

    In Database1.mdb I have a table called tblExport1 in which I would like to export into Database2.mdb and rename the table to tblExport2009. At the end of the year I will do the same thing, but this time I will rename the table to tblExport2010. For now I accomplish this manually by simply...
  7. KP_SoCal

    Change font color on ALL form controls on "Got Focus" and "Lost Focus"

    Change font color on ALL form controls on "Got Focus" and "Lost Focus" On my form I have numberous command button controls. As you can see from my code below, I'm applying one style of font and color when the control has focus and I'm applying another style when it loses focus. To accomplish...
  8. KP_SoCal

    If certain type of file is open, fire VBA sub routine

    I'm working in an Access 2007 environment. When I run a sub routine from Access, I would like it to check if for any open xls files. If there are any open xls files, I would like to fire a msgbox and exit the sub. I posted the basic structure of the code below, but I do not know how write...
  9. KP_SoCal

    Query an entire row within a Table produced by a CrossTab Query

    I would like to query each entire row in Table1 as opposed to a column for wherever Field2, Field3, or Field4 contain XYZ. The results would be displayed something like Table2. "YES" if row contains "XYZ" in Table1 and "NO" if it does not contain "XYZ" under any of the fields for that particular...
  10. KP_SoCal

    Splitting a string in one field to multipe fields in another table

    This is somewhat complicated. For Table1, each record of text Field1 has string length in multiples of 3 that is no greater than 12 characters and no less than 3 characters. For instance: Table1 Record1 = ABC123ABC Record2 = 123 Record3 = ABC123 Record4 = 123ABC123ABC In a query (perhaps...
  11. KP_SoCal

    "In Between" function that behaves similarly to a "Mid String" function

    "In Between" function that behaves similarly to a "Mid String" function In Table1, I have field name WidgetID whose records have an alpha-numeric constant of 1A23 at the beginning of each string and 432A1 at the end. In between could be any number of alpha-numeric characters. I’d like to return...
Back
Top Bottom