Thanks so much, for sharing this video, really by your great ideas, you move the MS Access to another level, of course that is come from your love to MS Access. we appreciate it.
Just found you you tune channel while searching for MS access and Genealogy. Watched the 2 into videos but could not determine what the other 7-8 are named. Do you have a play list for your Access Genealogy series as mentioned?
When you call the function here (8:35), you need to write FilterCharacters(phone & "", ...), i.e. concatenate phone with a double double-quote "" to ensure it is always a string, because the function expects a string there. If the user deletes a phone number on the form, the phone field will become null, and FilterCharacters(phone, ...) will cause a run-time error. But FilterCharacters(phone & "", ...) will still work, and in fact return the correct result. Your students should still benefit from your video since it is mainly about filtering. They shouldn't copy your code verbatim anyway, even when it's error-free. You are teaching them lessons, not doing their homework for them. They should learn from your lessons and write their own code to suit their individual needs, unless they hire you as a consultant who codes for them.
Good points all around. You could also wrap it in the NZ function: Phone = FilterCharacters(Nz(Phone, ""), "1234567890") I don't always think of ALL of the possibilities when I'm prepping a video/class. These things usually come up later in the usability phase, or as I like to call it, the "oh shit, bug!" phase. :)
Many thanks, suppose we need to exclude some characters such as "tab", sometimes we copy paste and the source has a tab, then it is very tricky to work with the field when a "tab" is sitting there, well, when we want to exclude some characters, we make the code like this ? If Cpos = 0 Then (insteaf of If Cpos 0 Then...)
Thanks so much, for sharing this video, really by your great ideas, you move the MS Access to another level, of course that is come from your love to MS Access. we appreciate it.
You are so welcome!
Thank you richard, you are a goldmine
Wow, thanks
Interesting to see your way to replace the unwanted characters. Another way to change the phone would be using regular expressions object with VBA.
Sure
Just found you you tune channel while searching for MS access and Genealogy. Watched the 2 into videos but could not determine what the other 7-8 are named. Do you have a play list for your Access Genealogy series as mentioned?
Here ya go: 599cd.com/GenDB
When you call the function here (8:35), you need to write FilterCharacters(phone & "", ...), i.e. concatenate phone with a double double-quote "" to ensure it is always a string, because the function expects a string there. If the user deletes a phone number on the form, the phone field will become null, and FilterCharacters(phone, ...) will cause a run-time error. But FilterCharacters(phone & "", ...) will still work, and in fact return the correct result.
Your students should still benefit from your video since it is mainly about filtering. They shouldn't copy your code verbatim anyway, even when it's error-free. You are teaching them lessons, not doing their homework for them. They should learn from your lessons and write their own code to suit their individual needs, unless they hire you as a consultant who codes for them.
Good points all around. You could also wrap it in the NZ function:
Phone = FilterCharacters(Nz(Phone, ""), "1234567890")
I don't always think of ALL of the possibilities when I'm prepping a video/class. These things usually come up later in the usability phase, or as I like to call it, the "oh shit, bug!" phase. :)
Many thanks, suppose we need to exclude some characters such as "tab", sometimes we copy paste and the source has a tab, then it is very tricky to work with the field when a "tab" is sitting there, well, when we want to exclude some characters, we make the code like this ? If Cpos = 0 Then (insteaf of If Cpos 0 Then...)
The tab character would be filtered out if it's not in the allowed list.