A combo box can also use a value list as its rowsource. The fact that the
values in A, B and C are different with each record wouldn't matter, because
the value list would contain the *names* of the controls, not the values
stored in the controls. (Although you *could* do it that way too, by
building the value list dynamically in the form's current event). Of course,
if the method you're using now works for you, that's fine. Just bear in mind
that the user can type anything at all (or nothing at all) in that InputBox.
> I don't see how I could use a combo box. The Values in A, B and C are
> different with each record of the parent. The only combo boxes I've had
> experience with are when you look up from a table. In my instance A, B
> C are completely different fields. At any rate; the code Brendan provided
> does what I need so I thank him very much.
> > Untested air-code:
> > strControlName = InputBox("A, B, or C?")
> > Me!NameOfControl = Me.Parent.Controls(strControlName)
> > Wouldn't a combo box be better? If you set the Limit To List property to
> > 'Yes', the user can only select values in the list. Using the InputBox,
> > you'll have to code for the possibility that the user may enter
> > other than A, B, or C.
> > --
> > Brendan Reynolds
> > > I have a Parent Form. It includes 3 controls called A, B, and C.
> > > each contain bits of information that vary from record to record.
> > > I have a SubForm. In this subform, I would like a command button so
> > > when the user clicks it, an inputbox will popup and the user can then
> > enter
> > > "A", "B" or "C" and the value of A, B or C from the parent form will
> > > entered into a field of the subform.
> > > Is this making sense? I am new to VBA and access and would really
> > > appreciate if someone could point me in the direction of some code
> > > might help.
> > > Thanks in advance