Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.databases.ms-access > #11978
| From | "Stuart McCall" <smccall@myunrealbox.com> |
|---|---|
| Newsgroups | comp.databases.ms-access |
| Subject | Re: Code library and classes |
| Date | 2016-08-17 21:06 +0100 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <np2g3n$bfg$1@gioia.aioe.org> (permalink) |
| References | <d6fdbb09-d4e1-4fb5-a404-51bb3a0e3cf6@googlegroups.com> <note9p$1kd8$1@gioia.aioe.org> <fa49e5ab-1c96-46e4-8728-02b3fa6a744f@googlegroups.com> |
<internet.shopping@foobox.com> wrote in message news:fa49e5ab-1c96-46e4-8728-02b3fa6a744f@googlegroups.com... > On Monday, 15 August 2016 23:04:47 UTC+1, Stuart McCall wrote: >> <internet.shopping@foobox.com> wrote in message >> news:d6fdbb09-d4e1-4fb5-a404-51bb3a0e3cf6@googlegroups.com... >> >I trying to set up an .accdb code library to use with a number of >> >programs. >> >Not sure why I haven't done this years ago! >> > >> > Is it possible to define classes in a code library for use in the main >> > database? I am having a problem with it at the moment. >> > >> > Jim >> >> You could set up a public function in the ACCDB that returns a new class >> object: >> >> Public Function New_Thing1() As ClassName >> Set New_Thing1 = New ClassName >> End Function > > Looks promising but I am having a problem with it. > > In my code library I have > > Public Function theWebClient() As WebClient > Set theWebClient = New WebClient > End Function > > However when I put > > Dim ApiPostClient As Object > Set ApiPostClient = theWebClient() > > in my main database I get the error: > Sub or function not defined. > > Both the main database and the code library are in the same directory > (folder). > > Am I missing some magic to enable the one part to see the other? > > I am adding this to some an existing library where other existing > functions show up correctly. Well the last time I worked in Access was 10 years ago. A2003 was the last version I used, and the method I described always worked with that and previous versions. A reference was not required because the library was in the same folder (as you have it). Don't know why it's not working for you. Perhaps someone with experience of later Access versions may be able to help.
Back to comp.databases.ms-access | Previous | Next — Previous in thread | Find similar | Unroll thread
Code library and classes internet.shopping@foobox.com - 2016-08-15 12:04 -0700
Re: Code library and classes "Stuart McCall" <smccall@myunrealbox.com> - 2016-08-15 23:04 +0100
Re: Code library and classes internet.shopping@foobox.com - 2016-08-16 07:11 -0700
Re: Code library and classes Mike P <mikewpayne@tiscali.co.uk> - 2016-08-17 06:50 -0700
Re: Code library and classes internet.shopping@foobox.com - 2016-08-18 04:44 -0700
Re: Code library and classes "Stuart McCall" <smccall@myunrealbox.com> - 2016-08-17 21:06 +0100
csiph-web