Solved

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

Posted on 2015-01-30
10
123 Views
Last Modified: 2015-01-30
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.
0
Comment
Question by:Shaft960
  • 4
  • 3
  • 3
10 Comments
 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility
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
 

Author Comment

by:Shaft960
Comment Utility
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
 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility
are you sure the name of the textbox is "Firstname" not something else? txtFirstname?
0
 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility
can you upload a copy of your db
0
 

Author Comment

by:Shaft960
Comment Utility
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 74

Expert Comment

by:Jeffrey Coachman
Comment Utility
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
 

Author Comment

by:Shaft960
Comment Utility
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
 
LVL 74

Expert Comment

by:Jeffrey Coachman
Comment Utility
Suppose they mis-pell one of them?
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
Comment Utility
;-)
0
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
Comment Utility
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

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now