Enabled Text Box

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
 
N

Nikos Yannacopoulos

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
 
G

Greg

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


.
 
N

Nikos Yannacopoulos

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


.
 
G

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


.


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top