Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Force Text Box entry based on drop down selection 1

Status
Not open for further replies.

springwood01

Technical User
Jul 30, 2006
14
US
I have looked at some of the posts but can't find my situation. I am fairly new at Access and have an project form that is initially filled out by a unit lead, indicating who it is assigned to with a status of “Open” from a drop down box. It is then given to an employee to complete. Once the employee returns the completed project, the leader will change the project status to “Closed”. They must also fill in the # of minutes used to complete the work as told by the employee. Is there a way to force the unit leader to make a Time entry of minutes once they select “closed” from the drop down box.
 
Have a look at these, they should help:
Control Closing Of Form Or Database
faq702-1870
KISS way to force users to click a command button to exit a form regardless of menu or toolbar options
faq702-2071
 
A common way is to enforce the validations rules in the BeforeUpdate update event procedure of the form, playing with the Cancel argument and the SetFocus method.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
thnks for your responses. I hadn't planned on putting my code on a close button, but if need be I can do that.

This is what I can come up with at this point if I use bottons/check boxes, one for "Open" and one for "Closed". What I really want is to keep my drop down with the "open" and "closed" choices. However, with the check boxes, here is what I have now. As I said, I am somewhat new at this and would like to at least get this part working. If you can show me how to use this correctly with my drop down, I would appreciate it.

Fields
Check Box- Open, Check Box-Closed
text Box (Time) that is # data type.

Private Sub Close_AfterUpdate()
If Me![Close] = True Then Me![Time] = Number
If isNull[Time], Then
MsgBox “Must Complete Time Field upon Project Close.”
Cancel = True
End If

End Sub

 
A starting point:
Private Sub Close_AfterUpdate()
If Me![Close] Then Me![Time].SetFocus
End Sub

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
thanks for the starting point PH. I will work with it and think this will get me to where I want to be. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top