Enable text boxe

jmriddic

Registered User.
Local time
Today, 18:14
Joined
Sep 18, 2001
Messages
150
Hi,

I want a text box on my form to only be enabled when a certain value is selected from a drop down box that is located on the form. I would tried to place the code in the After_Update Event for the dropdown box to do this but I already have a Macro there that performs a different function. I tried placing the code in the Lost_Focus Event but it doesn't work. The code is as follows:

If Me!cboActivity.Value = "Community Outreach Event" Then
Number.Enabled = True
Else
Number.Enabled = False
End If

Do I need to place this in another Event besides LostFocus? I would appreciate any help on this.
 
2 possible options spring to mind
a) add this to your macro or
b) (Preferred) convert your macro to code and add the new if..Then there.
HTH
 
You can still have your macro run and add the If then to the After_Update.

just place the DoCmd.RunMacro("MacroName") - I think that's the syntax - in the after update, then continue with your if then.
 
Macros are slower by nature and add additional objects to your database. Suggest you use a DoCmd.
 
Hi I tried doing that but it is now saying there is not a field name 40?

I have synchronzied combo boxes on my form so the Value that gets stored in the table is the ID Number of the Fields not Text Portion. Here is what I have typed.

DoCmd.Requery ([Response])
DoCmd.GoToControl (Response)


If Me.cboActivity = "Community OutReach Event" Then
Me.Number.Enabled = True
Else
Me.Number.Enabled = False
End If

So do I need to specify the different ID numbers for Community Outreach Event because there are different ID numbers because of all the different types of employees. I would appreciate any help.
 

Users who are viewing this thread

Back
Top Bottom