Enabled Text Box

  • Thread starter Thread starter Greg
  • Start date Start date
G

Greg

Hello,
I am opening a form using docmd code behind a command
button. There is a text box on the form, [id], that I
want to be disabled when the form is opened. How would
that be coded?
Thanks
Greg
 
Greg,

Add an extr line of code right after the OpenForm command:

DoCmd.OpenForm stDocName,... (existing)
Forms(stDocName).Controls("id").Enabled = False

where stDocName is the variable holding the form's name.

HTH,
Nikos
 
Nikos,
I can not get the code to work. The actual form that is
being opened is "frminddata" and the field on the form
that I disabled is "envelopenumber". Could you please use
these names in the code you entered below?
Thanks
-----Original Message-----
Greg,

Add an extr line of code right after the OpenForm command:

DoCmd.OpenForm stDocName,... (existing)
Forms(stDocName).Controls("id").Enabled = False

where stDocName is the variable holding the form's name.

HTH,
Nikos

Greg said:
Hello,
I am opening a form using docmd code behind a command
button. There is a text box on the form, [id], that I
want to be disabled when the form is opened. How would
that be coded?
Thanks
Greg


.
 
Forms("frminddata").Controls("envelopenumber").Enabled = False

HTH,
Nikos

Greg said:
Nikos,
I can not get the code to work. The actual form that is
being opened is "frminddata" and the field on the form
that I disabled is "envelopenumber". Could you please use
these names in the code you entered below?
Thanks
-----Original Message-----
Greg,

Add an extr line of code right after the OpenForm command:

DoCmd.OpenForm stDocName,... (existing)
Forms(stDocName).Controls("id").Enabled = False

where stDocName is the variable holding the form's name.

HTH,
Nikos

Greg said:
Hello,
I am opening a form using docmd code behind a command
button. There is a text box on the form, [id], that I
want to be disabled when the form is opened. How would
that be coded?
Thanks
Greg


.
 
Works great! Thank you for your help.
-----Original Message-----
Forms("frminddata").Controls("envelopenumber").Enabled = False

HTH,
Nikos

Greg said:
Nikos,
I can not get the code to work. The actual form that is
being opened is "frminddata" and the field on the form
that I disabled is "envelopenumber". Could you please use
these names in the code you entered below?
Thanks
-----Original Message-----
Greg,

Add an extr line of code right after the OpenForm command:

DoCmd.OpenForm stDocName,... (existing)
Forms(stDocName).Controls("id").Enabled = False

where stDocName is the variable holding the form's name.

HTH,
Nikos

Hello,
I am opening a form using docmd code behind a command
button. There is a text box on the form, [id], that I
want to be disabled when the form is opened. How would
that be coded?
Thanks
Greg


.


.
 
Back
Top