From: D. Stacy on 5 May 2010 20:38 Have public function (loaded in the global module) that produces a variable as a double. That all works fine as evidenced by the debug.print method in the immediate window. I desire to have the current value of the variable displayed in a text box. I created a callback function (loaded in global module) that looks like: Public Function GetCurrentWork_GPCI() As Double Dim CurrentWork_GPCI As Double GetCurrentWork_GPCI = CurrentWork_GPCI End Function I can't figure out how to make it display; I've currently got the control source property set to =GetCurrentWork_GPCI(), but that just displays a 0. Please help!
From: Jeanette Cunningham on 5 May 2010 21:16 Stacy, just use the public function you created earlier, and importantly, you need to tell it what value to use for lCriteria. =FindGPCI_Work(Me!txtLocality_ID) The above is what goes in the control source for the textbox. Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia "D. Stacy" <david_d_stacy(a)msn.com.(remove_this_part).> wrote in message news:CA4E119A-7936-4F38-829A-1A8129F7305C(a)microsoft.com... > Have public function (loaded in the global module) that produces a > variable > as a double. > > That all works fine as evidenced by the debug.print method in the > immediate > window. > > I desire to have the current value of the variable displayed in a text > box. > > I created a callback function (loaded in global module) that looks like: > > Public Function GetCurrentWork_GPCI() As Double > Dim CurrentWork_GPCI As Double > > GetCurrentWork_GPCI = CurrentWork_GPCI > > End Function > > > I can't figure out how to make it display; I've currently got the control > source property set to =GetCurrentWork_GPCI(), but that just displays a 0. > > > Please help! > > > >
From: D. Stacy on 5 May 2010 22:10 Hi Jeanette, I entered that into the control source property and that produces the #Name? error. "Jeanette Cunningham" wrote: > Stacy, > just use the public function you created earlier, and importantly, you need > to tell it what value to use for lCriteria. > > > =FindGPCI_Work(Me!txtLocality_ID) > > The above is what goes in the control source for the textbox. > > > Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia > > "D. Stacy" <david_d_stacy(a)msn.com.(remove_this_part).> wrote in message > news:CA4E119A-7936-4F38-829A-1A8129F7305C(a)microsoft.com... > > Have public function (loaded in the global module) that produces a > > variable > > as a double. > > > > That all works fine as evidenced by the debug.print method in the > > immediate > > window. > > > > I desire to have the current value of the variable displayed in a text > > box. > > > > I created a callback function (loaded in global module) that looks like: > > > > Public Function GetCurrentWork_GPCI() As Double > > Dim CurrentWork_GPCI As Double > > > > GetCurrentWork_GPCI = CurrentWork_GPCI > > > > End Function > > > > > > I can't figure out how to make it display; I've currently got the control > > source property set to =GetCurrentWork_GPCI(), but that just displays a 0. > > > > > > Please help! > > > > > > > > > > > > . >
From: Jeanette Cunningham on 5 May 2010 22:29 Check that you are using the exactly correct name for that public function and that FindGPCI_Work(Me!txtLocality_ID) is still a public function in a standard module. Or we can do it like this: ---------------------- Private Sub Combo0_AfterUpdate() Dim lCriteria As Long Dim lngReturn as Long lCriteria = Me!txtLocality_ID lngReturn = FindGPCI_Work (lCriteria) Me.TextboxName = nz(lngReturn,0) End Sub ---------------------- Note: replace TextboxName with the name of your textbox Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia "D. Stacy" <david_d_stacy(a)msn.com.(remove_this_part).> wrote in message news:E5094B80-5BCC-492F-BDA8-FF7F698A5541(a)microsoft.com... > Hi Jeanette, > I entered that into the control source property and that produces the > #Name? > error. > > > > "Jeanette Cunningham" wrote: > >> Stacy, >> just use the public function you created earlier, and importantly, you >> need >> to tell it what value to use for lCriteria. >> >> >> =FindGPCI_Work(Me!txtLocality_ID) >> >> The above is what goes in the control source for the textbox. >> >> >> Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia >> >> "D. Stacy" <david_d_stacy(a)msn.com.(remove_this_part).> wrote in message >> news:CA4E119A-7936-4F38-829A-1A8129F7305C(a)microsoft.com... >> > Have public function (loaded in the global module) that produces a >> > variable >> > as a double. >> > >> > That all works fine as evidenced by the debug.print method in the >> > immediate >> > window. >> > >> > I desire to have the current value of the variable displayed in a text >> > box. >> > >> > I created a callback function (loaded in global module) that looks >> > like: >> > >> > Public Function GetCurrentWork_GPCI() As Double >> > Dim CurrentWork_GPCI As Double >> > >> > GetCurrentWork_GPCI = CurrentWork_GPCI >> > >> > End Function >> > >> > >> > I can't figure out how to make it display; I've currently got the >> > control >> > source property set to =GetCurrentWork_GPCI(), but that just displays a >> > 0. >> > >> > >> > Please help! >> > >> > >> > >> > >> >> >> >> . >>
From: D. Stacy on 5 May 2010 22:35
I got that issue resolved (typing problem!). Now I need to to just get the txt box to refresh after each change of the combo box. "D. Stacy" wrote: > Hi Jeanette, > I entered that into the control source property and that produces the #Name? > error. > > > > "Jeanette Cunningham" wrote: > > > Stacy, > > just use the public function you created earlier, and importantly, you need > > to tell it what value to use for lCriteria. > > > > > > =FindGPCI_Work(Me!txtLocality_ID) > > > > The above is what goes in the control source for the textbox. > > > > > > Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia > > > > "D. Stacy" <david_d_stacy(a)msn.com.(remove_this_part).> wrote in message > > news:CA4E119A-7936-4F38-829A-1A8129F7305C(a)microsoft.com... > > > Have public function (loaded in the global module) that produces a > > > variable > > > as a double. > > > > > > That all works fine as evidenced by the debug.print method in the > > > immediate > > > window. > > > > > > I desire to have the current value of the variable displayed in a text > > > box. > > > > > > I created a callback function (loaded in global module) that looks like: > > > > > > Public Function GetCurrentWork_GPCI() As Double > > > Dim CurrentWork_GPCI As Double > > > > > > GetCurrentWork_GPCI = CurrentWork_GPCI > > > > > > End Function > > > > > > > > > I can't figure out how to make it display; I've currently got the control > > > source property set to =GetCurrentWork_GPCI(), but that just displays a 0. > > > > > > > > > Please help! > > > > > > > > > > > > > > > > > > > > . > > |