Using a form to change a field value in multiple records

A

amiga1200

I have designed a form with a listbox containing the field names of which I
select 1 and then enter the value I would like in it, before I can change
then records I need to be able to select that field in the form.

Me.Main.(I need the field name to programatically appear here).value = value

Pls Help
 
A

amiga1200

Correction, it should read

Form_Main.(I need the field name to programatically appear here).value = value
 
J

John Vinson

I have designed a form with a listbox containing the field names of which I
select 1 and then enter the value I would like in it, before I can change
then records I need to be able to select that field in the form.

Me.Main.(I need the field name to programatically appear here).value = value

Pls Help

If Main is the name of the form, it's not needed: Me *means* "the
current form".

Also, Forms don't have Fields. They have Controls, which comprise the
form's Controls collection.

Try:

Dim strControlName As String
<your code>
strControlName = <the name of a control on the form>
Me.Controls(strControlName) = <some value>

John W. Vinson[MVP]
 
Top