Solved

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

Posted on 2015-01-30
10
124 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
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 119

Expert Comment

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

Expert Comment

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

Author Comment

by:Shaft960
ID: 40580954
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
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 119

Accepted Solution

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
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…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

920 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

16 Experts available now in Live!

Get 1:1 Help Now