Forms :: Gray-out / Disable Text Fields By Checking A Text Box
Nov 21, 2013
how can i disable a textfield or two in a form when the textbox is unchecked also how do i add a default value for it while the textbox itself is disabled, can i get away with it by adding a default value on the textbox?
On a form, I want to disable the save button, 'cmdSave' whilst the form's mandatory fields have been left blank.
I've put in a smart tag, called, 'Req' against each required field and have used the following code on the forms current event.
Code: Private Sub Form_Current() Dim ctl As Control For Each ctl In Me.Controls If ctl.ControlType = acTextBox Or ctl.ControlType = acComboBox Or ctl.ControlType = acListBox Then
[Code] ....
The save button is disabled, but it won't enable again after each field has data entered against it.
I also have this code in the AfterUpdate event in each required field:
Code: Private Sub cboErrorID_AfterUpdate() Call Form_Current End Sub
I have a form that some fields have gray font instead of black. All of the properties seem to be the same as the other fields. The issue has to do with the 'Manage Sales Order' Form in the 'Products' Database.
I'm trying to get a spell check to work on a text box on a form. i've got it popping the spell check window after the box has been updated but i'd prefer it to just highlight the errors in red, rather than pop the spell check box. another problem i'm having is when it's finished spell checking the box it moves the form back to the first record. this is the code i'm using.
Code:
Private Sub txt_notes_AfterUpdate() If Len(Me!txt_notes & "") > 0 Then DoCmd.SetWarnings False DoCmd.RunCommand acCmdSpelling DoCmd.SetWarnings True Else Exit Sub End If End Sub
I would like to disable editing in a text box once the information has been entered initially, but would like to be able to turn editing back on by double clicking the text box label. This is to be used for a database I'm creating for truck fleet management. Any ideas??
using Ms access 2010.I have two text boxes where depending on what is entered on the first the 2nd disabled.that works fine but if I make a mistake and enters a value on the 2nd while it is enabled and return back to the first and enters a value which disable the 2nd, it disable it ok but keeps the value and even save it to the table.
Private Sub q300_AfterUpdate() If Me.q300 = "1" Then Me.q300_1.Text = "" Me.q300_1.Enabled = False Me.q301.SetFocus Else Me.q300_1.Enabled = True End If End Sub
Even with autocorrect disabled I still get Expr#: in all my queries when I import them, how can I stop this?
(there are 500 or so queries so must be a bulk method and many of them are based on temp tables created during running so getting all the source tables is not an option)...
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
on "After update" event for Confirm password a code needs to find if both Passoword and confirmpassword are having the exact character (Case sensitive).
Below code doesn't recognize the Case. It allows as long as both words are same:
Dim StrString1, strString2 As String StrString1 = Password srtString2 = ConfirmPassword
I have a problem with the connection between the labels and fields in designing my form.Is there a command do eliminate the association between the two? If not I was thinking if there is a problem to delete the labels and make new ones but by doing this Access (2010) says the label is unassociated.
Quick question with respect to Ms-access Forms.I have a few forms on my database. I have created a button and set it's click event to open another form in addmode, but when the form opens all my field borders ar missing. I have attached a screen shot of the issue I am facing. All the text fields are border-less I dont know why.
I wanted to combine 2 fields and a text in one text field on the access form.I have a field called "SentDateTime" and a field "Comment" I wanted to create it like this: MSD Message sent on 24/12/2014..I tried this formula in a unbound text field and it did not work:
I need making a search function for a form. I have a form with details about telephone counselors and want to be able to place a text box at the top that allows me to search through all the fields in the tables that the form relates to or displays.
I am working on a database project using Access 2010 and encounter some ComboBox text color problem,
The form has a ComboBox that displays the Supplier Name. The Combo's source control is Supplier ID in the Products table which joints the Supplier Table containing the Supplier Name. To display the Supplier Name only, I use a column count of 2 (for VendorID and VendorName) and column width of 0";2" so as to hide the SupplierID.
VBA is used to dynamically change the ForeColor and BackColor (via the Control Property ".ForeColor" etc) of the text in the ComboBox and TextBox. This works well for all TextBoxes and the ComboBoxes with direct data from the Products Table. However, for the ComboBox of VendorName, the BackColor can change but the ForeColor always remains as black. I have tried using the Format query such as "[White];@;[White];@" which works on the TextBox and other ComboBox (with direct field data from table), but the situation remains the same on this ComboBox which uses join-table reference via the VendorID.
Most my short text fields on my form are normal, but some have scroll buttons like a memo box and it's annoying, especially because the user can't jump to the next field by pressing return.
In a nutshell, I have a form where the 'Record Source' is a table titled 't_02_0_Assets'. I have several fields in the table that have foreign key references that utilize the Lookup Combo Box display control to allow users to select from a drop down list in the form.
The issue I am having is that I can't filter the text in the foreign key fields (only the ID's ).
My attempted solution was to create a control on the form (text box) and bind it to each of the foreign key ID's using the DLookUp function and then reference this control in the filter code.
My question is... how do I reference this DLookUp textbox in my filter VbCode?
I have attached a '.jpg' image of various aspects of the form including the filter code on the 'On Change' event.
My database has Main form and a Sub form. On main form i place one unbound text box named investigations. In subform of which datasheet there is a column named TestCode. I want unbound text box (Investigations) to display row values which selected in a column (TestCode) of subform.for example:Investigation field should display "CBC,HB,ALP".
I have a Form Display Data in my Access Database, which is working really well. However, users was asking if there is a way we can make Font Color Could/would change if The text in A field or Any field in my display form contained the word "SAD or MAD". Is there code for such thing in display form?..
I have several combo box fields in a bound form where they are selecting values from a list (values stored in a separate table) and then loading a number into the bound table field when selected.
How can I put a text prompt in these fields when loading the form which gets removed when focused and of course is not permitted to attempt a save into the bound numeric fields? I've done quite a bit of searching but can only find materials about doing this on bound text fields. I've also seen solutions using Nz which don't seem to work.
I have a form with two text boxes and a button. I want to be able to type a value into the first Text box click the button and the second text box to be filled with the value which is stored in the Table.
The first Textbox is called barTxt, The second Textbox is called CustTxt The button is called SearchBtn and the Table is called BookInTable. I have been trying to use the code.
Code:
Private Sub SearchBtn_Click() DoCmd.FindRecord Me.BarTxt.Value, , True, , True CustTxt.Value = "SELECT BookInTable.Customer FROM BookInTable " & _ " WHERE Customer = """ & Nz(Me.BarTxt) & """" & _ " ORDER BY Customer" End Sub
This however instead of displaying the Value for customer which is stored in the BookInTable. Displays The code SELECT BookInTable.Customer FROMBookInTable " & _ " WHERE Customer = """ & Nz(Me.BarTxt) & """" & _ " ORDER BY Customer"
DLookup function. (this is for a stamp collection database).
On my form ("InventoryInput") I have a text box called "Catalog" for a numeric entry and a text combo box for selecting a "Country" in drop down list.
I want to query a table called "CatNameList" to get the "StampName" of the item (based on the entries of Catalog and Country) and populate that name in the text box. The fields in this table are called "StampName", "CatNumb" & "CName" respectively.
I have successfully placed the following expression in the control source of that textbox and able to populate the StampName I need based solely on the catalog number alone.
That express is : =DLookUp("StampName", "CatNameList", "CatNumb = Form![Catalog]")
So it will populate the "StampName" data to match the "Catalog" number entry just fine.
However, I need to add a second layer to incorporate the Country.
Example : There is a catalog "1" for "USA", and a catalog "1" for "Canada" but both have different "StampName".
I have been attempting to get that second piece added with no success. Here is the expression I have been trying to get to work :
Right now, the text box is just blank with the above expression. I thought it may be because there was no match found, but I have triple checked to ensure I have the spelling correct on the country name in both places.
Basically, I just need the dlookup to take the "catalog" and "country" off the form and match it to the "CatNameList" table fields of "CatNumb" and "CName" to give me "StampName" field back on the form.