Search results

  1. Calvin

    Calculating Weekdays

    How to count and subtract Saturday and Sunday. The easiest way to count how many day-of-week days (ie. Sundays) are between two dates is like the following: intDaysInPeriod = DateDiff("d", StartDate, EndDate) intSaturdays = DateDiff("ww", StartDate, EndDate, vbSaturday)...
  2. Calvin

    Link Tables

    There is but it is code intensive and provides more flexibility for complex processes but what your doing sounds simple enough that what i suggested with using Append Queries should suit you fine as long as you do keep it straight and don't get to confused. Good Luck.
  3. Calvin

    How many PrimaryKeys should a table have?

    Thanks Pat, great answer. :)
  4. Calvin

    Strip out everything after a string

    Nope, [caption] is the name of your source field, since your using a comparison expression you will have to rename the field of your newly evaluated data with another name as not to confuse with a Circular Reference otherwise it will try to evaluate itself. This is normal. You can name the new...
  5. Calvin

    Link Tables

    link to each of the 9 tables on the different servers, then write 9 Append queries that will add the remote data to a local table and then to get this all to happen at once, assemble a macro executing each of the append queries one after the other or write a function in a module that does the same.
  6. Calvin

    How many PrimaryKeys should a table have?

    Mile-O-Phile, Then why didn't you say that before, you only confused the issue by saying there can only be one PK, yes there is one PK definition, but 32 fields defined in the PK would have been the correct answer. You know the guy is asking how many fields can be used in a PK. You've been on...
  7. Calvin

    Strip out everything after a string

    is the data in question always in the same location in the string, for example starting at the 15th character? or ending at the 20th character? or does it float in the string meaning it can be located anywhere in the string? in either of these cases you can write a custom function in a module...
  8. Calvin

    Strip out everything after a string

    "it needs to strip out everything after a certain string" where does this "certain string" come from?
  9. Calvin

    How many PrimaryKeys should a table have?

    Mile-O-Phile, Check your Doc's, and try an example yourself. You can assign multiples, for example sometimes a phone number field is not unique enough, in conjunction with a zip code field the two fields can be used together as PK's to uniquely ID the record. And doing so will allow the same...
  10. Calvin

    Strip out everything after a string

    Use an IIF function to make the determination of what is returned, ie. =IIF(Left([Field1],Len('Cool product that does this')='Cool product that does this', 'Cool product that does this', [Field1]) if you don't understand the syntax of the IIF function search this forum or look it up in Accesses...
  11. Calvin

    How many PrimaryKeys should a table have?

    One is generally enough for most processes and new processes. Only when the process requires it, for example working with legacy data collected from an old process, have I needed to use two or three PK's to uniquely ID a record and the new process would not allow the concatination or changing of...
  12. Calvin

    Calculating Average length of stay

    First lookup DateDiff in Access' help files for how to use the function or search this forum, there's hundreds of examples. Second, no you don't have to create a new field in the table. just a third column in the design of the query. In your query design add the start date and stop date columns...
  13. Calvin

    Calculating Average length of stay

    use the DateDiff function to determine the amount of time and usually setting it to return minutes is best practice as it is easier to convert back to hours and days as needed. You can use DateDiff in a query comparing the two fields on the fly and outputing the minutes into a third field.
  14. Calvin

    Control

    forms have "On Timer" or Form_Timer events (same thing), open up form properties, and set the "On Timer" event to "[Event Procedure]" and set the "Timer Interval" property to 1000 (milliseconds = 1 second) and then in code under the Form_Timer event add the code to check the IF statment and open...
  15. Calvin

    Control

    use a timer on your main form to open the popup 1 second after it loads.
  16. Calvin

    Control

    How about in your Form_Open or Form_Load events.
  17. Calvin

    Type problem - Comparing a numerical value to string value

    at the time of comparison use CInt() to convert the string to an integer or Clng() to convert to a long and vise-versa you can use Cstr() to convert a number to a string.
  18. Calvin

    Creating temporary tables

    Yes, lookup creating and destoying TableDef's. But creating and destroying causes the mdb to inflate and requires repairing and compacting more often and increases the chances of becoming corrupted.
  19. Calvin

    DELETE TABLE Query?

    delete the data in a table or completely destroy the table itself?
  20. Calvin

    Getting value into a text box

    insert the following into the Text box Control Source and change the field name and table names accordingly: =Nz(DLookup("[FieldName]", "[TableName]", "[ID]=1"),"") replace the [ID]=1 with whatever WHERE criteria you want to use or remove it to return the first record in the table. The Nz...
Back
Top Bottom