Forms :: Table Form - Disable Fields Based On A Value Of Another Field

May 27, 2013

I have a table form (I want to have many records available in the screen)

I want to disable fields based on a value of another (main) field.

The fields are check boxes, so the automate formatting is not available.

I use the VBA code below:

Select Case name1
Case "POINT"
Me.sf1.Enabled = False:
Case "SIDE OUT"
Me.sf2.Enabled = False
Case Else
Me.sf3.Enabled = False
End Select

but the fields become disable to all records, not only to the records under the right condition. Why?

View Replies


ADVERTISEMENT

Forms :: Disable / Lock Fields On Form And Subform Based On Checkbox

Feb 15, 2014

I am trying to lock records on a form and subform after a checkbox has been ticked, have used the code below from a previous post.

Private Sub Form_Current()
If Locked = -1 Then
Me.AllowEdits = False
Me.AllowAdditions = False
Me.AllowDeletions = False

[Code] .....

This is locking the Main form records is there a way to code this so that the fields on the subform are also locked when the checkbox is ticked?

View 7 Replies View Related

Forms :: Disable All Fields On A Form When Field Is Not Null

Sep 22, 2014

I have a form called PAF_Assignment and on this form there are many textboxes for editing. After all fields are entered, the user clicks on a button and this button populates the PAF_Issued_Date field with the actual date.

Then I want to disable (enable=False) all fields on this form once there is a date on PAF_Issued_Date as I don't want any user to make any changes after submitting it, although the user would still be able to read the information submitted.

I have tried the following...

PAF_Assignment Form AfterUpdate Event
If Me.PAF_Issued_Date=Not null Then
Me.FieldName1.Enabled=False
Me.FieldName2.Enabled=False
Me.FieldName3.Enabled=False

[Code] ......

However this is not working, there is no error message or anything but the fields remain enabled with the date...

View 3 Replies View Related

Enable/Disable Fields Based On Table

Oct 13, 2006

Hi everyone,

Need some help here! I have a table where different types of records are recorded. Let say for argument's sake my tblMain looks like this:

RecID (autonumber)
EntryType (Combo box linked to my tblEntryType)
Field1 (text)
Field2 (text)

I then have tblEntryType which lists the different types of entries to be made and which fields are required on my form and what the lables should be. The structure looks more or less like this:

EntryID (autonumber)
EntryName (text)
Field1Req (true/false)
Field1Tag (text)

On my form, my record source is tblMain. When my user makes a selection in the combobox EntryType, there is a lot of code behind the AfterUpdate function like this:

If EntryType.Column(2) = True Then

Me.field1.Enabled = True
Me.lblfield1.Caption = Me.entrytype.Column(3)
Else
Me.field1.Enabled = False

End If

I find this setup a bit labour intensive, especially as my form has quite a few fields! Is there a way that I can "look up" which fields are required from the table and enable/disable and label based on my tblEntryTypes without me having to creating so much code/use the "column" function.

Let me know if I am not making myself clear and I will be glad to try explain so more!

Tx in advance,

Mel

View 1 Replies View Related

Enable/Disable Fields Based On Table

Oct 13, 2006

Hi everyone,

Need some help here! I have a table where different types of records are recorded. Let say for argument's sake my tblMain looks like this:

RecID (autonumber)
EntryType (Combo box linked to my tblEntryType)
Field1 (text)
Field2 (text)

I then have tblEntryType which lists the different types of entries to be made and which fields are required on my form and what the lables should be. The structure looks more or less like this:

EntryID (autonumber)
EntryName (text)
Field1Req (true/false)
Field1Tag (text)

On my form, my record source is tblMain. When my user makes a selection in the combobox EntryType, there is a lot of code behind the AfterUpdate function like this:

If EntryType.Column(2) = True Then

Me.field1.Enabled = True
Me.lblfield1.Caption = Me.entrytype.Column(3)
Else
Me.field1.Enabled = False

End If

I find this setup a bit labour intensive, especially as my form has quite a few fields! Is there a way that I can "look up" which fields are required from the table and enable/disable and label based on my tblEntryTypes without me having to creating so much code/use the "column" function.

Let me know if I am not making myself clear and I will be glad to try explain so more!

Tx in advance,
Mel

View 1 Replies View Related

Forms :: Populate Form Fields Based On Selection In Another Field

Jul 18, 2013

I have a Customers table and an Orders table. My Customers table is a bit different than the norm because I couldn't figure out any other way to do this.

My client's customers are either businesses (companies) with a contact person, or individual customers. So, in the Customers table, I have the following fields (there are others but do not apply to my problem):

Customer ID
Company
Contact
Customer

So, if it is a company the data entry person would enter the company name and the full name (EX: Doe, John) in the contact field, but if it is an individual customer, then they would leave Company and Contact blank and enter just the Customer name (Ex: Doe, Jane).

So, in the Orders table, I have combo boxes for look ups for the fields Company and Customer.

That works okay, but I would really like for the Customer ID to post into a text box once the Company or Customer has been selected. In other words, the input person would enter the name, then it would show that Customer's ID #.

View 1 Replies View Related

Forms :: Graying Out / Disabling Field Based On Other Fields On Form / Subform

Jun 27, 2013

I am wanting to grey out/disable a field on a form based on entries in two other fields being the same. One of these fields that contains the data to be referenced in on a sub-form.The form is called 'Payment_Information-Form', the field to be greyed out/disabled is called 'SUF A Paid?'

The fields that are being referenced are: 'Set up fee in s (SUF) Recrt Restriction A <=' which is on the main form, and 'SUF_Letter' which is on a sub-form (within the main form). The sub-form is called 'Costings_11_Previously_Paid_SUF subform'.If 'Set up fee in s (SUF) Recrt Restriction A <=' equals 'SUF_Letter' then grey out.I tried the following formula in both the On Current and After Update sections but it hasn't work.

=IIf([Forms]![Payment_Information-Form]![Costings_11_Previously_Paid_SUF subform].[Form]![SUF_Letter]=[Set up fee in s (SUF) Recrt Restriction A <=],[SUF A Paid?].[Visible]=True,[SUF A Paid?].[Visible]=False)

View 4 Replies View Related

Forms :: Populate Control In A Form Based Off Of Two Different Fields In One Table

Jun 24, 2013

I am wanting to populate a control in a form based off of two different fields in one table. Is that possible?I have a table called tblEmployeeMaster and it has a LastName column and a FirstName column in which I need to have both first and last name show up in one box on my form?

View 6 Replies View Related

Code To Disable A Field Based On The Values Of Another Field

Nov 10, 2005

If I have the following Code to disable a field based on the value of another field:

Private Sub lstAgreementType_AfterUpdate()

If Me.lstAgreementType.Value = "BN" Then
Me.txtSenateAandCDate.Enabled = False
Else
Me.txtSenateAandCDate.Enabled = True
End If

End Sub

But I also need it to disable the field is equal to "BA" or "BT" as well, how would I add that to my code?

View 3 Replies View Related

Tables :: Disable A Record From A Table Based On Attribute Of Another Table

Jan 12, 2013

I have a keys table and a keysctivity table. I need keys to not be available if they are currently signed out (return_date is null) or if they have been marked as lost (lost_key = true)

This is my activity table. URL....If for example signin_id 1 was not returned or was lost, key_id 1 should no longer be available. Is this something that can be done?This is the access file I am working on: URL....

create two new tables "lostKeys" "unreturned_keys" and have records moved to their respective tables based on whether they are indicated to be lost or currently not returned.

View 4 Replies View Related

Autofill Fields Based On Results From Another Field In The Table?

Apr 18, 2007

I have an Access database with several tables and a multitude of subforms which are displayed on a single master form. The subforms are used to facilitate data entry. In several of the tables there are fields which are related and I would like to have some of these fields updated based on the results entered in the related field (i.e. the answer for one field depends on the other).
Field 1Field 2
[facing][DISC_CODE]
un3
up1
dn2

Field 1 is a simply a description of the basic dataset. This field is already set-up on form as a combo box that allows the user to choose one of three options. Field 2 is a code number used by another piece of software to identify a particular symbol. It is a new field being added to the database. There are 200 codes that identify a wide range of symbols for different types of data and I don’t want to have to look them up when I, or my assistants, are doing data entry.

My question is this; is there anyway to have the DISC_CODE value, Field 2, automatically entered in the table when the value for Field 1 is selected in the combo box on the form?

View 1 Replies View Related

Forms :: Enable / Disable Button Based On Textbox

Aug 12, 2013

I'm trying to have a button in a form that, when clicked, will time stamp a text box already formatted for time. But once the text box is filled with a time, the button then disables itself for that record.

If I switch to another record where the text box is empty, the button will enable itself without closing the form, but obviously re-disable itself if I go to a record the text box is filled.

I'm sure I could use conditional formatting for it, but I don't think I'm going about it the right way. I already got a basic button built to timestamp.

View 5 Replies View Related

Modules & VBA :: Lock Certain Fields On Form Based On Value In A Particular Field

Aug 4, 2015

I'm trying to lock certain fields on my form based on the value in a particular field. It seems to work the first time but applies itself to all other records in the database from then on!

The starting point is a command button that sends an email and makes Me.DPLLock = 1. The corresponding table entry is formatted as a number.

The code is...

Private Sub Form_Current()
If Me.DPLLock = 1 Then
Me.OR_Name.Locked = True
Me.OR_Sales_Order.Locked = True
Me.OR_WO_No.Locked = True
Me.OR_Qty.Locked = True

[Code] ....

Ive tried Me!DPLLock with the same result.

View 7 Replies View Related

How Can I Configure A Table To Auto Data Entry Into Fields Based On A Previous Field

Aug 31, 2006

My situation is this. I have 3 tables that I have imported from my mainframe system, between these 3 tables I have the data of product code, description,supplier code, supplier name, order method, and ABC code.

I am trying to create another table that I can capture daily Out Of Stock data for products.

What I would like to do is to enter the product number in the first field of my new table, and then the remaining fields will auto populate with the correct details based on the product data stored in the parent tables that I have imported.

How can this be done?

View 3 Replies View Related

Forms :: Disabling Fields In Access Based On Data Entered In A Previous Field

Sep 9, 2013

How to disable fields in Access based on data entered in a previous field? For example if "yes" is chosen from a drop down show "Date field" if "no" is chose hide "Date Field".

View 2 Replies View Related

Update OnHandQty Table Field Based On Qty Field From Another Table / Form

Oct 30, 2012

I have a table called Inventory (table1 - PK=INVID) that contains all inventory ID numbers and descriptions. I have another table called Inventory Transactions (table2 - FK=INVID) that gets updated through a form. When a new transaction is made in table2, I want the transaction amount to get added or subtracted to an OnHandQty field in table1. I tried having table2 (transaction table) as the main form and then table2 as the subform, but I couldn't get table2 to update.

View 5 Replies View Related

Forms :: Enable / Disable Check Boxes Based On Combo Box Selection

Jun 17, 2015

im trying to enable/disable checkboxes based on a combobox selection for instance,

i make the selection in a combo box called terms and conditions. i want it then to only enable the business,domestic and summary check boxes for that type, with the onther check boxes staying disabled. is there a way this can be done through code like the statement "only enable if this letter type selection has been selected"

View 14 Replies View Related

Forms :: Disable Or Hide Button Based On Date Condition In MS Access

Jul 17, 2015

I have a form that has a listbox and a subform. The listbox lists names of events, start date and end date. The subform bellow reveals names of participants to the event that is clicked in the listbox. Against each participant's name is a button to delete the participant.How can I hide or disable the delete button if the start date of the event is past?

View 1 Replies View Related

Forms :: Disable / Enable Fields Not Working For A New Record

Aug 9, 2014

I have some code like this that sets some fields up to be disabled when the form loads, then enables them when a combo box ('Type') is selected to 'Instrument'. This works fine as far as it goes, but if the user has selected 'Instrument' and then goes to a new record, the fields remain enabled.

Private Sub Form_Load()
Me.CalibrationTolerance.Enabled = False
Me.AcceptanceLimit.Enabled = False
End Sub

[Code] ....

I've looked this up and it appears I need to use the property Form.NewRecord, but nothing I do seems to make it work.

View 8 Replies View Related

Forms :: Can Make Form Based On Fields From 2 Tables?

Feb 15, 2014

I have created simple data base containing 2 tables connected each other and I wanted to make a form with fields taken from those tables and unfortunately it did not work and I got errors message.

Before I start to build the form do I need to create the query based on those tables and having the fields I need for the form? If yes, what sort of query, simplest one?

View 6 Replies View Related

How To Hide/disable A Button On A Form Based On SecurityID Level

Sep 29, 2005

Hi,

Trying to remember how to hide/disable buttons on a form based on the users security levl they have. :)

View 2 Replies View Related

Modules & VBA :: Updating A Field In A Form Based On Another Table Field

Sep 13, 2013

Using Access 2010. Fairly new to automation and macros.I have two tables (tblProductReceived and tblBins) and a form (frmProductReceived).A field in tblBins corresponds to a location the bin is at (named BinLocationID) and the tblProductReceived table tracks product that a specific bin has received.

What I need is for the tblProductReceived field PRLocationID ([tblProductReceived].[PRLocationID]) to be automatically populated with where the bin is at ([tblBins].[BinLocationID]) when selecting a specific bin in the form (frmProductReceived).

View 1 Replies View Related

Forms :: Autofill Field Based On Related Field In Previous Form

Jun 30, 2015

I have my Assets form and the primary key is the ChargerID, in this form I have an "Add New Job For This Asset" button, which opens up the Jobs form at a new record.

How do I make it so that the ChargerID field is automatically filled with whatever the previous record was instead of being blank.

For example if I have Charger12345 open in the Asset form, I'd like to click the Add New Job button and it automatically have Charger12345 in the ChargerID field of the Jobs form.

View 5 Replies View Related

Forms :: Adding Fields In A Table And Having Output Fill Fields On A Form

Jan 29, 2014

I have a totalquery that runs fine and give me the sum for both fields I'm looking for but I can't get the outputs to fill the fields on the form. I have tried the Dcount query in the control source but that just returns an error and locks up access.

Code:
SELECT [Tble-wcDelays].Causedby, Sum([Tble-wcDelays].HoursDelay) AS SumOfHoursDelay
FROM [Tble-wcDelays]
GROUP BY [Tble-wcDelays].Causedby, [Tble-wcDelays].LinkingID
HAVING ((([Tble-wcDelays].LinkingID)=[Forms]![Frm-ePlusCent]![cleanID]));

That is the query.

View 14 Replies View Related

Forms :: Coloring Form Field Based On Another Field Content

Jun 4, 2013

I am making a very simple 'registration' database for a children's event in a couple of weeks.I the table/form there is a checkbox field called 'consent' which, if checked, indicates that a child can leave the event without parental consent.

There is a report printed on each child (a registration page which the leaders get a copy of). I would like on this report a 'red box' to appear if the child cannot leave without permission (i.e. the consent box is not checked). I would also like this 'red box' to appear on the form. I had thought of doing it this way - but I'm not sure if it's the best, or if it's possible:

Have a field in my table called 'consentindicator'. When the 'consent' box is checked, there is a period ('.') placed into the 'consentindicator' field. It is set to turn red when a period is present. That way, when the consent box is checked, a get a red 'box'.

View 12 Replies View Related

Modules & VBA :: Code To Lock / Disable All Form Fields On Inputted Value?

Oct 25, 2013

I am looking to completely disable a record when a specific Yes/No tick box is checked.

By that I mean all form fields are locked and disabled when the Yes/No tick box is checked (Yes)

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved