Search results

  1. bastanu

    Function in a loop

    (y) :) You're very welcome, good luck with your project!
  2. bastanu

    Function in a loop

    Private Function BeginDate(rsLeave As Date, rownum) As String If Month(rsLeave) = "1" Then If Day(rsLeave) = "1" Then BeginDate = "CR" & rownum
  3. bastanu

    Function in a loop

    That is what I had in post 10 as the first alternative, but that is not the problem. A VBA function returns a value; in your you do not as you are using a variable declared in an external sub to assign the value to. You need to replace "startRange" with "BeginDate" everywhere within the function...
  4. bastanu

    Function in a loop

    Have a look at this: https://bettersolutions.com/vba/variables/lifetime-scope.htm
  5. bastanu

    Function in a loop

    Because the function has no idea what startRange is, select the entire function code and replace startRange with BeginDate.
  6. bastanu

    Function in a loop

    Please show what you have (take a screen shot with the highlighted row and error), hard to guess :). startRange = BeginDate (rsLeave![Start Date], rownum)
  7. bastanu

    Function in a loop

    So I use the variables in the function. Do I need to Dim the variables in the function even though they are defined in the sub? You could make startRange and endRange variables public (declaring them as Public at the top of standard module, not inside the sub) or better use the syntax I showed...
  8. bastanu

    Function in a loop

    You do not have to initialize the variables unless you need a certain initial value, strings will be "", boolean ones will be false, etc. Put a break after it and see what this line shows: startRange = BeginDate rsLeave![Start Date], rownum
  9. bastanu

    Function in a loop

    That line should probably be something like this: With xlSh.range(BeginDate(rsLeave![Start Date], rownum), FinDate (rsLeave![End Date], rownum)) .Interior.ColorIndex = 4 End With 'or cleaner startRange = BeginDate rsLeave![Start Date], rownum endRange = FinDate rsLeave![End Date]...
  10. bastanu

    Function in a loop

    You do not use the functions after you call them, the startrange and endrange are still=""
  11. bastanu

    Function in a loop

    You didn't show the function but it does not matter, you get the error because when calling the function you pass it a date (rsLeave![Start Date]) but the function expects a recordset.....
  12. bastanu

    Function in a loop

    rsLeave![Start Date] will return a date (the actual start date value). Change your functions to have the first argument as Date.
  13. bastanu

    Hop do I format the contents of a bookmark in certain documents with access

    If you are using true mail merge fields then look into using switches for those fields: https://thesoftwarepro.com/date-text-mail-merge-formatting-in-word-document/...
  14. bastanu

    Creating a table in the backend Database with vba

    If you are "pushing" a table from the front-end to the back-end you might find my free utility here handy: http://forestbyte.com/ms-access-utilities/fba-fe-to-be-table-push/ Cheers,
  15. bastanu

    Solved Open Textfield in Zoom

    Have a look at the attached sample that uses a custom pop-up form instead of the built-in zoom window. Works as you mentioned (on double-click). Cheers,
  16. bastanu

    Welcome new Access MVP Colin Riddington (isladogs)

    Congratulations Colin!
  17. bastanu

    Upload files to FTP or WEB Disk

    Here is an older file (mdb) I used to download files from FTP, the code is there to upload as well. Cheers,
  18. bastanu

    Solved Odd error in my database

    I would also look at the Trust center and make sure you have the trusted locations set for the local folder where the front-end resides.
  19. bastanu

    Access Front-end Auto-Updating Utility ?

    No problem David, I hope I didn't say anything wrong, I am not that good at web development so I will need the hosts to see if they spot anything. The launcher on my web is an accde, please feel free to PM me if you would like a copy of the accdb. Cheers,
  20. bastanu

    Access Front-end Auto-Updating Utility ?

    @NauticalGent: thanks for helping! Not sure why 403 happens, I'll send a support request to the hosting providers shortly!
Back
Top Bottom