How to disable a field in a form when you enter a subform

I want to disable the field called [Firstname] in a form called Mastercamp when I enter a subform called Campdate.


I keep getting error messages.
Shaft960Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

 
Rey Obrero (Capricorn1)Commented:
which event are you using to disable the control [firsName]

try using the focus event of the subform or the got focus of a  control in the subform

post the code you are using.
0
 
Shaft960Author Commented:
On the subforms got focus I have this

Private Sub Form_GotFocus()
Forms![mastercamp].[Firstname].Enabled = False
End Sub

I was getting an error... now nothing happens
0
 
Rey Obrero (Capricorn1)Commented:
are you sure the name of the textbox is "Firstname" not something else? txtFirstname?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
Rey Obrero (Capricorn1)Commented:
can you upload a copy of your db
0
 
Shaft960Author Commented:
0
 
Jeffrey CoachmanMIS LiasonCommented:
I'm confused,
If you are in the subform, you cant edit the main form anyway.

If you disable the control when you enter the subform, do yo ever want to enable it?

Can you explain the need for doing this?
0
 
Shaft960Author Commented:
I want the field Firstname to be disabled once it is filled... I have coding in the subform that prevents going into the subform until Firstname and Lastname are filled..
0
 
Jeffrey CoachmanMIS LiasonCommented:
Suppose they mis-pell one of them?
0
 
Jeffrey CoachmanMIS LiasonCommented:
;-)
0
 
Rey Obrero (Capricorn1)Commented:
something wrong with your subform "Campdate" probably corrupted

use the Mastercamp1 for testing

check the codes in the click event of the buttons.
TestCamp.mdb
0

Experts Exchange Solution brought to you by ConnectWise

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.