I assume you mean "bound control". A control can be bound to a field, but a
field itself is neither bound nor unbound.
PtKey is the name of both the function and the field (or control)? That's
almost certainly at least part of the problem.
Your code fragment suggests you are setting strTemp to the value produced by
the PtKey function. To set a field value you need to turn it around.
Assuming a field of a different name than the function name:
Me.FieldName = PtKey
Thank you Bruce, Part of the problem with a newBee is that even the questions
are a challange,
The ModPatientKey has a Function PtKey (I learned from a previous error
both could not have the same name) and my form has a controll named Key
bound to a Table with the field Key and I would like to outopopulate this
field with the result of the function which produces the :
strTemp = PtKey
this function works as I am able to debug.Print PtKey but not
outopopulate.thaks any help is appreciated

Signature
timH
> I assume you mean "bound control". A control can be bound to a field, but a
> field itself is neither bound nor unbound.
[quoted text clipped - 18 lines]
> >
> > As Always Thank you for your assistance.
BruceM - 01 Apr 2008 19:30 GMT
First of all, Key is a reserved word in Jet. Reserved words should not be
used for names of fields, controls, objects, or anything else. For more
information, see:
http://www.accessmvp.com/JConrad/accessjunkie/resources.html#ReservedWords
and
http://allenbrowne.com/AppIssueBadWord.html
I would use a different name for controls than are used for fields, too.
That being said, this should work, as I suggested in my first response (but
with a made-up field name):
Me.Key = PtKey
or
Me.Key = strTemp
The other way around you are setting the value of the variable to the
field's (or control's) value.
> Thank you Bruce, Part of the problem with a newBee is that even the
> questions
[quoted text clipped - 36 lines]
>> >
>> > As Always Thank you for your assistance.
AccessVandal - 02 Apr 2008 05:25 GMT
Since you’re a newbie, you migth as well give us the complete code for the
Function and tell us how did you trigger the function from.
There are bound Forms and Controls and unbound Forms and Control.
If the control is bound to the Form’s RecordSource, you cannot use the
controlsource to call the function directly. You’ll have to use an event in
the Form or in a Control to Auto populate the field (control) in your form.
As regarding your function, it appears that your function is not returning
any value at all. Normally, if you want the function to return something,
‘do something blah
‘blah blah
‘return strTemp to function
PtKey = strTemp
If you want to return the as a string, include the type as String like…
Public Function PtKey() As String
>Thank you Bruce, Part of the problem with a newBee is that even the questions
>are a challange,
[quoted text clipped - 12 lines]
>> >
>> > As Always Thank you for your assistance.

Signature
Please Rate the posting if helps you