?
Solved

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

Posted on 2015-01-30
10
Medium Priority
?
134 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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
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 2000 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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

864 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