Using a form to change a field value in multiple records

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
Correction, it should read

Form_Main.(I need the field name to programatically appear here).value = value
 
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]
 
Back
Top