Search results

  1. R

    expression in default value

    Hi - You need to be using an immediate if (iif). Here's an example from the debug (immediate) window: x = "john" ? iif(x ="john", 8,9) 8 x = "joe" ? iif(x ="john", 8,9) 9 HTH - Bob
  2. R

    Query - Start Date End Date For Report

    Hi - This may simply be a typo, but in your explanation you list: ...but in your code it's: Note it's CQStartDate vs. CQdatestart and CQEndDate vs. CQdateend. Hope that may help - Bob
  3. R

    Short Name from Full Name

    Hi - Here's a function that will recreate a short-name, regardless of the number of middle names: '************************************************ Examples: Best wishes - Bob
  4. R

    Short Name from Full Name

    Hi - This can be done using a full-name field. Try playing with this: Here's a version of the instrrev() function: If, perchance, names are stored as LastName, FirstName MiddleName (a common practice in some environments) you can do this: Best wishes - Bob
  5. R

    Days left in the year from a date

    Hi - Try playing with this: Best wishes - Bob
  6. R

    Assigning postcodes to regions

    Hi - If Postcodes are similar to your example, and you are seeking to extract the portion to the left of the space, try playing with this: HTH - Bob
  7. R

    Question Extracting part of a date

    Hi - Try something like: x = now() ? format(x, "mmm") Feb HTH - Bob
  8. R

    Get dates based on the day

    Hi - Assuming you are working with Sunday = 1 thru Saturday = 7 HTH - Bob
  9. R

    Add chr in string

    Hi - Try this (example from the debug/immediate window): -or- HTH - Bob
  10. R

    If Statement for a Query Using SUM

    Hi - Check-out the nz function in the help file. It should give you what you need. Best Wishes - Bob
  11. R

    Extract numbers from text

    Hi - Try copying the following to a module, then call as shown: Function SaveNumer2(ByVal pStr As String) As Long '******************************************* 'Purpose: Removes alpha and non-numeric characters from ' a string 'Coded by: raskew 'Calls: Function IsNumeric()...
  12. R

    "Like" condition query not returning the correct values

    Hi - You might try playing with this (from the debug window): '************************* x = "thisisatest.com" y = "thisisatest.abc" ? left(x, instr(1, x, ".com")-1) thisisatest ? left(y, instr(1, y, ".abc")-1) thisisatest '************************* HTH - Bob
  13. R

    Removing Spaces in a text field

    Hi - Here's another function you may want to check out. It will remove specified characters, as well as spaces. Function despace(ByVal pstr As String, pItem As String) As String '******************************************* 'Purpose: Removes characters from a string 'Coded by: raskew...
  14. R

    Tricky Recursive Function

    Hi - I posted this ages ago. You might give it a try to see if it's close to what you're after. Best wishes - Bob
  15. R

    Call to goto specified module and open to specified function/sub

    Hi - Thanks much for that! I also answered my own question when I found where I'd used the OpenModule method of the Microsoft Access DoCmd object For example, this line of code: docmd.OpenModule "Utility Functions", "DeleteTableTest3" would display the DeleteTableTest3 sub in the Utility...
  16. R

    Call to goto specified module and open to specified function/sub

    Hi - Looking for the capability to go to (from a highlighted treeview control) specified module and display specified function/sub. All suggestions appreciated. Best wishes - Bob
  17. R

    Median and Undefined Function Error

    Hi - Give this a try against the Northwind database. It works for me. Best wishes - Bob Function MedianF(pTable As String, pfield As String) As Single '******************************************* 'Purpose: Return median value from a recordset 'Coded by: raskew 'Inputs: ...
  18. R

    Outlook Calendar Control Needed

    Hi - Try a Google on Anytime Organizer. I've used it for years and I suspect you'll find it provides what you're after. Best wishes - Bob
  19. R

    Query that splits digits into 2 seperate fields

    Hi - Here are some examples returning text or digits from a string, depending if your number is actually digits or text: ********************* 'Convert number to text x = 234568 ? cstr(left(x,2)) 23 ? cstr(mid(x, 3,2)) 45 'Extracting part of number x = 12345 ? left(x, 2) 12 ? mid(x,3,2) 34...
  20. R

    Count the number of Fridays between 2 dates

    Hi - Here's another you can try: Public Function GetWeekDays(pmoyr As String, pDays As String) As Integer '************************************************ 'Purpose: Compute number of weekdays ' in the specified mm/yyyy ' where 1 = Sunday thru 7 = Saturday 'Coded by...
Top Bottom