Solved

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

Posted on 2015-01-30
10
125 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 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 40580897
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
ID: 40580904
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 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 40580916
are you sure the name of the textbox is "Firstname" not something else? txtFirstname?
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 40580917
can you upload a copy of your db
0
 

Author Comment

by:Shaft960
ID: 40580954
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 40580967
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
ID: 40580986
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
ID: 40581010
Suppose they mis-pell one of them?
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 40581013
;-)
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 40581028
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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…

774 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