OK. Both combo boxes and text boxes certainly do have a Value property.
But
wasn't there some mention of a subform in one of the earlier posts? When
a
form is being used as the SourceObject of a subform control, that form is
not added to the Forms collection. If you're assigning a value from a
control on a parent form to a control on a subform of that parent form,
the
code would look something like ...
Forms!ParentForm!SubformControl.Form!TargetControl =
Forms!ParentForm!SourceControl
If the code is running behind the parent form, you can shorten that to
...
Me!SubformControl.Form!TargetControl = Me!SourceControl
If the code is running behind the subform, I believe you could use ...
Me!TargetControl = Me.Parent!SourceControl
.... but that's from memory, I haven't done that recently enough to be
100%
sure of the syntax.
--
Brendan Reynolds (MVP)
Mario G. said:
Hi Brendan,
The one control in which we are retrieving the value from is a combo
box
control and the assignment control is a text box. Yes I am coming from
a
VB
background and have taken over this Access project from a former
employee
who
left the company.
:
What type of control is it?
Re the Text property, that's as expected - you have to set the focus
to
an
Access form control before you can refer to the Text property. If
you're
coming from VB, you may expect the Text property to be the default
property,
but the Value property is the default property of an Access form
control.
--
Brendan Reynolds (MVP)
Hi Alex,
Yes i've compiled the project, verified all references (which would
have
failed during the compilation process), and compacted and repaired
the
DB.
Still no luck. In debug mode, i can access certain properties like:
[Forms]![Application]![ControlName].Name
[Forms]![Application]![ControlName].Enabled
but for some reason i cannot access the following two:
[Forms]![Application]![ControlName].Value
[Forms]![Application]![ControlName].Text
For the first one i get error 2424. When i use the second line i
get
an
error message saying that the control doesn't have focus.
Any ideas?
:
Hi Mario,
Have you tried to compile the project?
Have you checked your references to make sure that are all there
and
none are missing?
Have you tried to compact and repair the database?
Regards
Alex