How I Can Set A Text Field’s Properties Enabled = No
Jun 12, 2006
In a simple data retrieve/update form, how I can set a text field’s properties Enabled to No based on that particular record value?
For instance, there are 4 fields, employeeid, employeename, employeetitle, employeephone
I would like to set the employeephone text field’s properties Enabled = No, if the employeetitle is Manager
I have only been playing with MS Access for a little while and I do not know all there is to know yet so I figured I come here to ask a question.
I use MS Access in web design and lately I have been experiencing a problem with my registration form which inserts new users into an MS Access database table.
Lately my registration form has become a target for spammers trying to inject spam in the form of html code into the password field of the online registration form.
I figured that I could deter this from happening by only allowing the letters A - Z and numbers 0 - 9 in the field and not allowing characters like < > and ? and ".
I assume I can do this with a validation rule but I'm unsure as to how I would go about setting this up. Limiting the field size to only 50 characters does not seem to work unfortunately.
Any help on how to set up a validation rule would be appreciated.
After some suggestions, I have a form with combo boxes, the combo boxes are set to enabled "no", but become enabled by an after update command on another field.
The after update command works perfectly, however once enabled I need to ensure data is selected, as opposed to leaving blank.
I have several buttons on a form and I want to set enabled = false on one of them when I open the form - that's fine
I have two txt fields - ReceiptNo and BankPaymtId if the both have a value I want to make the button enabled = True
This is the code I have used on the BankPaymentId On Dirty event
Private Sub BankPaymentId_Dirty(Cancel As Integer) If Me.[ReceiptNo] <> "" Then If Me.[BankPaymtId] <> "" Then Me.CreateOutlay.Enabled = True End If End If End Sub
This is the one for ReceiptNum on Dirty event
Private Sub ReceiptNum_Dirty(Cancel As Integer) If Me.[ReceiptNo] <> "" Then If Me.[BankPaymtId] <> "" Then Me.CreateOutlay.Enabled = True End If End If End Sub
I am making a new Record in the design view of a table (creating a new field in the table), and I am assigning it a date type, is there a hotkey that will select the field properties sheet so that I can select the format of the field without having to move my mouse?
Hi, I would like to change the properties of either the column heads in a combo-box or the column names for tables. I don't think there's any way to adjust the column head properties, and I'm doubtful there's a way to change the column caption properties.
Some of my column titles are long, and I'd like to be able to word wrap them essentially. Anyone know if this is possible? Thanks.
I created and new field and made the source "Unbound" so that it is not connected to the field I copied it from. How do I now make that the information I enter in the new field does not duplicate in all of the similar fields in other entries.
Specifically, my database is a database of employees and the field Title is "Active". If I enter "Yes" by one employee entry, all employee entries will then state "Yes" by the Active field.
How can I change the properties so that by some employees I can write "Yes" and by others I can enter "No".
I am not so familiar with Access so if you can be specific I would greatly appreciate it.
VBA syntax for changing various "Field Properties" on an EXISTING table. Specifically, the field properties I'm trying to change are:
Field Size (I want to make this 'Double') Format (I want this to be 'Standard') and Decimal (I want this to be '2') The Data Type is already set as 'Number'.
I try to put an expression for the property "bound column" so that my lookup values will be directly dependent on one of attribute's choice
I have got four options for my attribute. Each option will use a slightly different set of lookup values. I save all four sets in another table.
Then in my properties definition I refer directly to this table as lookup base. When I put bound column number equal to an expression so as to choose the right column of lookup values it refuses. It seems that it does notl ike anything other than a numeric value.
If that's a no-go, I am not sure how to achieve what I try to do then?
Essentially I have a table that 4 attributes: QID,itemID,CatType,Catchoice
CatType can have only 4 values. Each value will make Catchoice take on a different set of combo values
The problem I am having is that I am stuck at the Catchoice lookup definition because it is dependent on what kind of CatType the user picks.
I have 4 fields that are unbound on a form. img1 img2 img3 img4..When these are entered they are all combined and autofill another unbound textbox = imagename.. what i would like to do is from this unbound textbox 'imagename' ..i would like to populate a textbox that IS bound called FileName
[Event Procedure] Private Sub imagename_Click() Me.imagename = Me.FileName End Sub
Have a number of tick boxes on different forms. When the form is opened the tick box appears to be greyed out however it is enabled. Is there any way that these tick boxes can appear enabled???
I am having a mare trying to do something which I think should be quite simple, as follows.
In a table I have the field [Entitled]. On my form I have this as a yes/no check box.
I have the following code in the VB.
Private Sub Check112_AfterUpdate() If Me![Check112] = True Then Me![Entitled].Visible = True (or I could use) Me![Entitled].Enabled = True Else Me![Entitled].Visible = False (or I could use) Me![Entitled].Enabled = False End If End Sub
Some people have the field checked and others do not.
The problem is; when I check or uncheck the box on individual records shown on the form, the value is remebered when I scroll to the next record (i.e. the box may be unchecked but the field is still visible/enabled). It is doing my head in! Help Please.
I have a form with many command buttons. This form is a master for a database that keeps time for my department. One command button is a setup button that I want the user to run once and only once. What code, and where do I put it will allow my to set the command button's visible or enabled to be false. Even when the user closed the database and reopend it, if the user has run the setup once, I do not want to allow them to run it again.
I want a combo box to be enabled only when I want to edit the data in the cbo for that particular record or when the fo0rm is on a new record. So, by default the cbo is Enabled No and Locked Yes. I placed a button on the form and put the following in the On Click:
Code:
Private Sub cmdEditContactsType_Click() Me!cboContactFilter.Enabled = True Me!cboContactFilter.Locked = False End Sub
But when I press the button the control remains disabled.The field has several Contact genres and since I'm using the data in a split form allowing edits to the single form side I don't want this cbo enabled during browsing.
I have a form for creating a new database record for a list of "components".
One button "add_component" adds a new record. One text input "component_input" allows you to enter in the "name" of the component. One button "save_component" saves the record.
The component_input and save_component have their default "enabled" property set to "No" in their properties list.
I only want the component_input and save_component form objects to be enabled once the "add_component" button has been clicked. Once the "save_component" button is clicked, I want them to return to being disabled. This will prevent any accidental over-writing of records.
I have used "build event" for the "add_component" button...
Code: if [macroError] <> 0 then ## errorMessage here ## else setProperty control name: component_input property: enabled
[Code] ....
And then I have used "build event" for the "save_component" button...
Code: if [macroError] <> 0 then ## errorMessage here ## else setProperty control name: component_input
[Code] ....
Now, this works when add_component is first clicked, however when I click save_component neither component_input or save_component become disabled again.
i have a problem i hope some one can help me with.
i have a form with a sub form on it, and i want to disable everything until the user clicks a 'edit' button to allow the information to be changed.
i am just testing it at the moment, so i set one text box's enabled property to false. then i added a button with an on click event with the following code:
Me!userid.Enabled = True
when i start the form, the userid box is disabled and when i click on the edit button, it enables it fine.
however, when i change to the next record, the userid box remains enabled. i cant find where to put the code to set it back to false everytime i change the record.
i should also let you know i am a beginner, so please be gentle!
I presently have a form that I have all the fields set as read only by using the enabled and the locked property of each field. However I have to be able to open the form to certain users with all fields enabled and unlocked. I need code that will run through each field and set the field's enabled to True and the locked to false. This code I will apply to a button that will open the form.
I created a database which when macros are enabled the only thing visible on the screen is the forum. All tables as well as the ribbon bar is disabled. I also disabled right-clicking.
My issue is, for those who do not have macro's enabled, it opens up in design view and allows access to the left-hand tables until the user clicks the trust button at the top. Once trust is clicked, everything hides as expected.Is there a way to restrict access if they do not have their macros enabled?
im creating a form in design view but the icon to show the fields from the table that i want the fields to come from isnt being displayed; how do i get it to show?
I am using Office 2007 and trying to export a table in Access to a Macro-Enabled workbook in Excel. Unfortunately, when I go to export the table, my file does not show when I browse for the file and .xlsm doesn't look like it's a supported file extension. I have looked around and noticed others have this problem as well. One solution was to use save the Excel file as a 97-2000 file since it doesn't change the file extension based on having macros. However, I can't do this because then I lose functionality with tables and other things on my spreadsheet. I need the data in Excel to be updated every month. Is there any way to do this in Access? I'm going to explore using sharepoint. My DB options are limited to Access and Sharepoint. I don't have access to Oracle or SQL Server or MySQL etc.