Search results

  1. A

    My Query choked--- then slipped into a coma!!!

    The following code should allow you to loop through all the tables in your database and check for a particular field name and then if a record exists with a particular value within that field. The code is specified to work with string values only so if you are searching for number or date...
  2. A

    Get Stage Date and Description Using SQL Problem

    Without seeing some sample data I'm not positive, but you should be able to get the required data using an outer join query giving all parent records regardless of child records, i.e. left outer join from parent to child. This should give you data for all parent records that have child records...
  3. A

    Calculate a date based on dropdown

    You should calculate the completion date in a query or direct on a form rather than storing in the table. Create a query and add a field as below to get your result CompDate:IIf([state]="Emergency",[orderdate]+1,IIf([state]="Urgent",[orderdate]+7,[orderdate]+28))
  4. A

    Linked Tables

    Another way of doing this would be to 1) Import the text file each time to a specific table, set up an import specification to suit and use TransferText 2) Empty the backup table 3) Append from imported table to backup 4) Convert Dates 5) Convert Times
  5. A

    Automatic Link to DAO 3.6 Object Library

    Take a look here http://support.microsoft.com/kb/194374
  6. A

    Printing date range on report

    What I suggested should work fine, you should only get the one prompt for each of the values. A way to ensure it works is to change your query so that it includes your parameter prompts as fields, name them appropriately. Then on the report set the controlsource of the current data field to...
  7. A

    How to query the caption of a command button

    You can use the following string as your criteria in a query to use the value of the text in the caption of a command button. [forms]![YourFormName]![YourCommandButtonName].caption
  8. A

    Append Query missing from Query tab, but it's there!!

    To try and recover the SQL in the query copy the following code into a module and then go to the Immediate Window and type in Call GetQrySQL("YourQueryName") and press return to run If the query is found it should return the SQL from the query to the immediate window. When you have the SQL...
  9. A

    Looping through a query

    If the output below is what you are looking for then a simple query will suffice rather than using the function assuming your table tblIT0008WageTypeValues has only one record for every WageTypeNumber. WTNum BET01 1000 5 1033 45 2050 500 Query as follows will suffice for above, I've called the...
  10. A

    Expiry date in Access

    Create a query on the member table, and set the criteria as below under the YourExpiryDate field. <=Date()+30 This should return all records whose expiry date has already passed or is within the next 30 days.
  11. A

    Printing date range on report

    Add a new text box to the Report, remove it's label. Set it's controlsource to ="Current Report Date : " & [Beginning Date?] & " to " & [End Date?] Change 'Beginning Date?' and 'End Date?' text to your own prompt messages used in query
  12. A

    Append Query missing from Query tab, but it's there!!

    Have you tried to compact and repair. OR If you are able to rebuild the query easily then create a new query and go to SQL view, type in DROP TABLE YourQueryName run the query, and this should remove the query fully from the database. You can then recreate the query.
  13. A

    Query problem - passing criteria

    Rather than typing in the supplier names why not provide a listbox of the supplier names and allow multiple selection from this. If you look at the example posted below you will see how to build your query string then from the items selected in the listbox...
  14. A

    Working History

    You have not set the dbs variable to anything so it cannot find the database object Put the following line before the dbs.execute line Set db = CurrentDb
  15. A

    Automating Date-Based Updates?

    One way to do this would be to have an update query run each time that the database is opened which would update the adoptability status on any animals who have been more than 3 days in the shelter and nothing has yet been entered in the adoptability status field. Query similar to below UPDATE...
  16. A

    Display only part of text in a field

    The following function should help in seperating out the relevant components of the string although it will take a bit of coding to loop through the string until all values are found. You will also need to use a Replace function on the passed data to change any double quotes to single so the...
  17. A

    Datepart function problem

    Try using the Format function as follows format([YourFieldName],"mmm yyyy") = Jan 2005 or format([YourFieldName],"mmmm yyyy") = January 2005
  18. A

    sorting on alfanumerical values

    Sorry had jumped the gun a bit there. The above function will only work if the lead characters are the same for all fields. To cater for differing lead characters you will also need to add the function below and another field to the query as GetLeadChar([YourFieldName]). This field will need...
  19. A

    sorting on alfanumerical values

    If you add the following function to your database and then add an extra field to your query as RmLeadChar([YourFieldName]) and set the order on this new field you should get the result you want regardless of how many leading characters are on the field. You can leave the new field hidden if...
  20. A

    Msgbox Options, Problems With HelpFile Parameter

    You need to provide a context number as well as the help file name so it should read MsgBox "Please enter a Paris ID", , strTitle, strHelp, intContext
Back
Top Bottom