From: D. Stacy on
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
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
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
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
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!
> > >
> > >
> > >
> > >
> >
> >
> >
> > .
> >