I personally prefer not to work with public variables.Regarding returning multiple values from one function,
see this post/example by MajP
I personally prefer not to work with public variables.Regarding returning multiple values from one function,
see this post/example by MajP
It's not a public variable. It's a user-defined type.I personally prefer not to work with public variables.
@gemma-the-husky
How about this : You have 3 returning values from one function.
Code:Sub test() Dim Param1 As Date Dim Param2 As String Dim Param3 As Integer Param1 = Date Param1 = MyFunction(Param1, Param2, Param3) Debug.Print Param1 Debug.Print Param2 Debug.Print Param3 End Sub Public Function MyFunction(Param1, Optional ByRef Param2, Optional ByRef Param3) As Date Param2 = "Kita Yama" Param3 = 100 MyFunction = DateAdd("d", 1, Param1) End Function
ChrisO was long gone by the time I came around, but it is obvious to the most casual observer that he was a tremendous asset and a real Access Heavyweight.searching Chris's stuff is both nostalgic and extremely educational!
That does not make sense at all. In an unhandled error all variables reset throughout the application. So in your example all those variables reset too. Only tempvars do not.I know but doesn't user-defined type reset because of an un-handled error?
I think most people feel this way. Almost never see people modify a passed variable in a sub, although it is completely legitimate. I find it hard to debug and follow the logic. When i do this accidently it can make your head spin debugging. My guess is that is why VB now defaults to byval.Yes - I now how to do it, it just feels slightly wrong when I use arguments as byRef
I was able to download it.David,
I noticed that the sample database on that latest link can not be downloaded. It appears to be a feature not yet available?? It would be nice to have some of the ChrisO gems/sample dbs available in newer version of Access.
so does that mean anyone building VB aps has to check all the code when recompiling?I think most people feel this way. Almost never see people modify a passed variable in a sub, although it is completely legitimate. I find it hard to debug and follow the logic. When i do this accidently it can make your head spin debugging. My guess is that is why VB now defaults to byval.
I do not understand the question. The default is simply byval. Not sure what that has to do with recompiling.so does that mean anyone building VB aps has to check all the code when recompiling?
I do not understand the question. The default is simply byval. Not sure what that has to do with recompiling.
Just saw this, you must have added it in an edit. I'll try and raise it with the tech team over there.This is the error message I got when trying to download the A97 file from UA.