Search results

  1. D

    change the background color of a query cell

    Is it possible to run a query and have the background color of the query field be highlighted if a certain criteria is met? I'd like to use the expresion builder if possible. For example if the values in field A and field B do not match, then field C should be a yellow background. If...
  2. D

    If no results then move to next qryDef....

    I can't seem to figure out how to write this IF statement. Any help is appreciated: See my commented out lines in the following code. .... 'open your query as RecordSource Set qdf = CurrentDb.QueryDefs("qry_55") With qdf qdfOLD = .SQL .SQL =...
  3. D

    .SQL Replace

    I have a make table query in MS Access. I want a variable in this query to change based on an array value. For some reason the .SQL Replace statement is not changing the value, even though when I debug and hover over the "x" array value it is there. My code is: Set qdf =...
  4. D

    zip a set of reports and email them

    I have a set of 10 reports that are produced using MS Access and exported to a folder on the network. My goal is to click a button on a form in MS Access, trigger some vba code that will zip this folder, attach it to an email and send it. Is this possible? I found this code that works for...
  5. D

    alter table with autoincrement field

    I am attempting to update an oracle table using MS Access. One of the fields to be updated is a primary key number field. I'd like to use the autoincrement field to update that field. My sql is: Alter table testAutoNum Add column progid autoincrement (1001,2) This sql nicely creates the...
  6. D

    Set TableDef for multiple tables

    I have the following function for tableDef that is working, but I don't want to have to repeat the code for each table. Can you tell me know to do this to include all the tables without repeating code? Function ShowConnectInfo(strConnect_ss) Dim dbs As DAO.Database Dim tdf As DAO.TableDef...
  7. D

    QueryDef with parameters - item not found

    I am getting an error. Item not found in this collection - runtime error 3265. I've searched online for the answer and I found that it is due to something incorrect in the spelling, etc. However, I have checked and rechecked. The query name is qry_55 The field is c.cnty_cd - However this query...
  8. D

    .sql replace for more than one field

    I'd like to use the follwong code to replace more than one field in the query. Can you tell me how that is done? Dim qdf As DAO.QueryDef Dim qdfOLD As String Set qdf = CurrentDb.QueryDefs("qry_55") With qdf qdfOLD = .SQL .SQL = Replace(.SQL, "c.cnty_cd = '01'", "c.cnty_cd='11'") '...
  9. D

    loop with multiple arrays

    I need to loop through two arrays changing the value in one field from the query and I cannot see how this is done. My code is below with my problem area highlighted in red. Instead of the qry55, I could insert the sql into this code, but that seems like the wrong path to take. Thanks for...
  10. D

    syntax help on join sql

    The syntax is not correct on this sql to use in MS Access. Can you help? I think I need brackets around the joins and/or 'inner' before the join.... select p.sw_index_id, [P.LAST_NAME] & ', ' & [P.FIRST_NAME] AS PERSONNAME1, cp.cnty_cd, p.ssn, p.last_chgd_dt, an.gender_cd, p.birth_dt...
  11. D

    translate oracle 'decode' to sqlserver 'case'

    I am trying to translate plsql (oracle) to sql for access (sql server). This is the plsql line of code: decode(alleg_determ_ind, 'Y', 'Y') as md The follwing are things I've tried, but none of them work: Select..... CASE alleg_determ_ind WHEN 'Y' THEN 'Y' ELSE 'N' END md CASE...
  12. D

    looping through multiple databases

    I need to create a loop that changes two items and I don't know how: 1 the variable in the sql - (c.cnty_cd = '11') 2 the database in the sql - (salti_person11) so that each time the sql runs a new item from the array is inserted for each of these. Any help would be appreciated. Dim...
  13. D

    looping through sql and skip if not result set found

    When I run the following sql (in a query) I enter information once for [enter cty id]. and it all works fine. What I would like to do now, is write the vba code so that the sql runs multiple times looping through a list of items. For instance instead of the popup window asking "enter cty...
  14. D

    coverstion from plsql to sql in MS Access

    I am trying to convert an sql statement from an oracle based platform to use it in MS Access (sql server platform). I'm getting a syntax error (of course), but I can't see where the problem is. The sql is below. Any help would be appreciated. select a.south_index_id, c.cnty_cd...
  15. D

    combo box to search over 100k records

    I have a database with over 100k records and I want to use a combo box to search for records by typing in the name. I found code to do this at: http://allenbrowne.com/ser-32.html. This is working, however i have many fields on the form that I want to populate from the table after the...
  16. D

    ListBox with CheckBoxes shows a new record checkbox

    I have a listbox with checkbox's based on a table. The listbox reflects everything great, except it shows an extra checkbox at the end of the list that does nothing. I think this is the "next record" from the table, but I don't want this to show. How do I hide or get ride of this extra...
  17. D

    Loop within a loop for min and max

    I have a query that has a column with “true” or “false” in it. I have vba code that loops through all the rows and finds the first “true” value in a column and saves certain info to a table based on that first row of the record set; it continues to loop until it finds the first “false” value...
  18. D

    Import email attachment(excel) to MS Access

    · I have emails with excel attachments coming in multiple times a day to outlook. · I want to click a button in Access and automatically import the last excel attachment in my email in box based on the timestamp of when it came in (thus getting the last one). Does anyone know how this can be...
  19. D

    multiSelect list box with input box

    I started with the code written by someone else. It is located at: http://www.datagnostics.com/dtips/multiselect.html I changed it slightly to save the selections from a list box and also allow the user to add information in an input box for each selection made. All seems to work well, if I...
  20. D

    How do I Link to Multiple Oracle databases?

    I am beginning to design a new Access application. I need to link to two separate Oracle databases. I know how to use odbc to link to one database, but how can I link to two different ones at the same time? Thanks.
Top Bottom