Making fields uneditable

I want to add a table to my database which has 3 fields, Date, Time, Action 
Log (I'll use field names that don't conflict with Access reserved names) I 
will then create a datasheet form with these fields as the source for 3 
controls. I want the Date and Time to be system generated as the user starts 
to complete the form. The Action log will be a memo filed. I can get this 
far but I want the fields to be un-editable once they have been input. I am 
trying to create an Action Log table for a user to complete as they perform 
an action, possibly on a daily but infrequent basis, which will be a record 
of their actions.
Can anyone help with how I make the data that is completed un-editable?
Thanks
Tony 


0
Tony
10/31/2007 11:04:52 AM
access 16762 articles. 2 followers. Follow

5 Replies
716 Views

Similar Articles

[PageSpeed] 44

Hi Tony

In your form design set the fields as locked (data tab of field properties)

Then go to the properties of the form - event tab - and for the On Current 
event enter the following event procedure...

Private Sub Form_Current()
    If Me.NewRecord Then
        Me.FieldName.Locked = False
    Else
        Me.FieldName.Locked = True
    End If
End Sub

Substitute in your actual field names.

hth

Andy Hull


"Tony Williams" wrote:

> I want to add a table to my database which has 3 fields, Date, Time, Action 
> Log (I'll use field names that don't conflict with Access reserved names) I 
> will then create a datasheet form with these fields as the source for 3 
> controls. I want the Date and Time to be system generated as the user starts 
> to complete the form. The Action log will be a memo filed. I can get this 
> far but I want the fields to be un-editable once they have been input. I am 
> trying to create an Action Log table for a user to complete as they perform 
> an action, possibly on a daily but infrequent basis, which will be a record 
> of their actions.
> Can anyone help with how I make the data that is completed un-editable?
> Thanks
> Tony 
> 
> 
> 
0
Utf
10/31/2007 11:56:01 AM
Use the Current event of the form.

Loop through the Controls collection of the form. Set the Locked property 
for the controls that are bound to fields (not expressions, nor unbound, nor 
controls like lines and command buttons that have no Control Source) based 
on whether the control IsNull().

-- 
Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Tony Williams" <tw@invalid.com> wrote in message
news:ekHaf36GIHA.3600@TK2MSFTNGP06.phx.gbl...
>I want to add a table to my database which has 3 fields, Date, Time, Action 
>Log (I'll use field names that don't conflict with Access reserved names) I 
>will then create a datasheet form with these fields as the source for 3 
>controls. I want the Date and Time to be system generated as the user 
>starts to complete the form. The Action log will be a memo filed. I can get 
>this far but I want the fields to be un-editable once they have been input. 
>I am trying to create an Action Log table for a user to complete as they 
>perform an action, possibly on a daily but infrequent basis, which will be 
>a record of their actions.
> Can anyone help with how I make the data that is completed un-editable?
> Thanks
> Tony 

0
Allen
10/31/2007 11:59:29 AM
Thanks guys but I'm slightly confused as you both seem to be suggesting 
something slightly different. In your example Andy you have shown only one 
field how do I add the other two fields? Is this what Allen means by looping 
through the fields? If so how would I code that? Also Allen, you mentioned 
not using expressions, I had intended the Date and Time fields to be the 
system date and time, this wouldn't preclude me from setting the locked 
property of these two fields would it?
Sorry for this, this is new to me.
Thanks
Tony
"Tony Williams" <tw@invalid.com> wrote in message 
news:ekHaf36GIHA.3600@TK2MSFTNGP06.phx.gbl...
>I want to add a table to my database which has 3 fields, Date, Time, Action 
>Log (I'll use field names that don't conflict with Access reserved names) I 
>will then create a datasheet form with these fields as the source for 3 
>controls. I want the Date and Time to be system generated as the user 
>starts to complete the form. The Action log will be a memo filed. I can get 
>this far but I want the fields to be un-editable once they have been input. 
>I am trying to create an Action Log table for a user to complete as they 
>perform an action, possibly on a daily but infrequent basis, which will be 
>a record of their actions.
> Can anyone help with how I make the data that is completed un-editable?
> Thanks
> Tony
> 


0
Tony
10/31/2007 12:20:19 PM
If a control is bound to an expression, its Control Source starts with "=". 
Example:
    =[Quantity] * [PriceEach]
There is no point locking these controls: they are not editable anyway.

Here's an example of code that loops through all the controls on the form, 
identifies those that have a Control Source, eliminates those that are 
unbound or bound to expressions, eliminates the autonumber, and also allows 
you to specify controls that should not be locked/unlocked:
    http://allenbrowne.com/ser-56.html

That code just locks/unlocks all the bound controls, so you will need to 
modify using IsNull(), and run it in Form_Current.

-- 
Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Tony Williams" <tw@invalid.com> wrote in message
news:O9neph7GIHA.2064@TK2MSFTNGP06.phx.gbl...
> Thanks guys but I'm slightly confused as you both seem to be suggesting 
> something slightly different. In your example Andy you have shown only one 
> field how do I add the other two fields? Is this what Allen means by 
> looping through the fields? If so how would I code that? Also Allen, you 
> mentioned not using expressions, I had intended the Date and Time fields 
> to be the system date and time, this wouldn't preclude me from setting the 
> locked property of these two fields would it?
> Sorry for this, this is new to me.
> Thanks
> Tony
> "Tony Williams" <tw@invalid.com> wrote in message 
> news:ekHaf36GIHA.3600@TK2MSFTNGP06.phx.gbl...
>>I want to add a table to my database which has 3 fields, Date, Time, 
>>Action Log (I'll use field names that don't conflict with Access reserved 
>>names) I will then create a datasheet form with these fields as the source 
>>for 3 controls. I want the Date and Time to be system generated as the 
>>user starts to complete the form. The Action log will be a memo filed. I 
>>can get this far but I want the fields to be un-editable once they have 
>>been input. I am trying to create an Action Log table for a user to 
>>complete as they perform an action, possibly on a daily but infrequent 
>>basis, which will be a record of their actions.
>> Can anyone help with how I make the data that is completed un-editable?
>> Thanks
>> Tony 

0
Allen
10/31/2007 12:43:20 PM
Thanks Allen, I think (????) I can follow that. I'll have a go and come back 
in a few days with any problems under a new post if that's OK?
Cheers
Tony
"Allen Browne" <AllenBrowne@SeeSig.Invalid> wrote in message 
news:%23vv1gu7GIHA.280@TK2MSFTNGP03.phx.gbl...
> If a control is bound to an expression, its Control Source starts with 
> "=". Example:
>    =[Quantity] * [PriceEach]
> There is no point locking these controls: they are not editable anyway.
>
> Here's an example of code that loops through all the controls on the form, 
> identifies those that have a Control Source, eliminates those that are 
> unbound or bound to expressions, eliminates the autonumber, and also 
> allows you to specify controls that should not be locked/unlocked:
>    http://allenbrowne.com/ser-56.html
>
> That code just locks/unlocks all the bound controls, so you will need to 
> modify using IsNull(), and run it in Form_Current.
>
> -- 
> Allen Browne - Microsoft MVP.  Perth, Western Australia
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> "Tony Williams" <tw@invalid.com> wrote in message
> news:O9neph7GIHA.2064@TK2MSFTNGP06.phx.gbl...
>> Thanks guys but I'm slightly confused as you both seem to be suggesting 
>> something slightly different. In your example Andy you have shown only 
>> one field how do I add the other two fields? Is this what Allen means by 
>> looping through the fields? If so how would I code that? Also Allen, you 
>> mentioned not using expressions, I had intended the Date and Time fields 
>> to be the system date and time, this wouldn't preclude me from setting 
>> the locked property of these two fields would it?
>> Sorry for this, this is new to me.
>> Thanks
>> Tony
>> "Tony Williams" <tw@invalid.com> wrote in message 
>> news:ekHaf36GIHA.3600@TK2MSFTNGP06.phx.gbl...
>>>I want to add a table to my database which has 3 fields, Date, Time, 
>>>Action Log (I'll use field names that don't conflict with Access reserved 
>>>names) I will then create a datasheet form with these fields as the 
>>>source for 3 controls. I want the Date and Time to be system generated as 
>>>the user starts to complete the form. The Action log will be a memo 
>>>filed. I can get this far but I want the fields to be un-editable once 
>>>they have been input. I am trying to create an Action Log table for a 
>>>user to complete as they perform an action, possibly on a daily but 
>>>infrequent basis, which will be a record of their actions.
>>> Can anyone help with how I make the data that is completed un-editable?
>>> Thanks
>>> Tony
> 


0
Tony
10/31/2007 1:04:34 PM
Reply:

Similar Artilces:

Make Default
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel Email Client: Exchange Hi I have a script to open entourage to configure a account, although the first time round for every user the script stops due to the message in Entourage asking would you like to make entourage you default browser. <br> Anyone have a script to set this to default or any way of setting this so it never ask's ? <br><br>thanks This is a multi-part message in MIME format. ----------------709806166701805979 Content-Type: text/plain; charset=iso-8859-1; format=flowed C...

Making a Pivot chart from 3 differnt sets of data / worksheets.
Hi, I have 2 workshsheets of data with a list of delivery dates of about 10 different products over the last 3 years, (i cant combine these to just 1 worksheet for other separate reasons) and a 3rd worksheet with a column of the same products and dates that some of these products became faulty and were sent back to me . On a 4th worksheet, I am trying to do a graph that looks at the 3 worksheets and plots pivot table of dates and amount of each product deliveries & returned to me. So as i select ,say, product A from that pivot list, it produces a graph for these 3 variables (dat...

making a transfer show up in the budget
Hi all. I am running MS money 2006. How do I make a transfer show up in my budget? I have several liabilities and credit cards, and I would like to make a budget with the monthly amount owed to each creditor showing up in my budget. The MS Money 2006 standard program does not allow me, as far as I can tell, to make a monthly transfer to a credit card or liability show up in my budget, unless I make it a category. Any help with this is much appreciated. thanks See http://umpmfaq.info/faqdb.php?q=124 for the short answer. You may be more interested in "cash flow" than &qu...

How make a favorite for all users in Ex2007/OWA/Documents area?
I am playing around with OWA in 2007 and exploring the "documents" feature of OWA that allows users to view Windows file shares by UNC. There is the individual "add to favories" option, but does anyone know of a way to administratively specify a favorite for all users? The alternative seems to be logon as each user to setup the same favorite--surely that is not the only way? Thanks for any help! Evan ...

Reversing name values in a field
Hi, I have a field called CustomerName that has values that are last name, first name. So there is a value of Smith, John which is John Smith. I want to preserve the value in this field but create a new field called CustomerName1 that has John Smith in it. It would need to somehow reverse the values based on the comma delimeter and then get rid of the comma. Can someone help? Thanks, -- Chuck W LN = Left$(CustomerName, InStr(CustomerName, ",") - 1) FN = Right$(CustomerName, Len(CustomerName) - InStr(CustomerName, ",")) -Dorian "ChuckW" wrote:...

making tickets
what is the best way to make numbered tickets using Publisher 2002? Hi lc (rconnell@numail.org), in the Microsoft Office Publisher newsgroup you posted: || what is the best way to make numbered tickets using || Publisher 2002? Check out the following link: http://www.mvps.org/publisher/numbering1.html -- Brian Kvalheim Microsoft Office Publisher MVP Official Publisher MVP Site: http://www.kvalheim.org This posting is provided "AS IS" with no warranties, and confers no rights. >-----Original Message----- >what is the best way to make numbered tickets using >Publi...

Concatenate with Javascript if 3 fields are present
I have 3 fields in a form that I need to concatenate into a string to populate a new field called Test ID, the format ulfor test id should equal LNAME_DOB_TestDate. Patient Name (format is LNAME, FNAME) DOB TestDate There should always be a comma between the LNAME, FNAME field. I need to parse out the LName to the comma to create the string LNAME_DOB_TestDate. This should only happen when all 3 fields are present. Any help appreciated. Thanks. ...

AN OPPORTUNITY TO MAKE $$$
THIS REALLY WORKS IF YOU FOLLOW THROUGH!!! MAKE MONEY!!! MAKE MONEY!!! MAKE THOUSANDS OF "$$$" !!! I found this "NETWORKING PROJECT" on a bulletin board and decided to try it: All I say is, it "WORKS". All it takes is a small INVESTMENT of your "TIME" AND "less than $10.00"! INTERESTED??? E-mail: "spotty3443@yahoo.com" for DETAILS. ...

Blank To and From Fields
We are on Exchange 2003 and my folks are receiving e-mail messages where both TO and FROM fields are blank. Is there a way to block messages when both TO and FROM are Blank? This is what the header looks like.... X-Comment: Sending client does not conform to RFC822 minimum requirements X-Comment: Date has been added by Maillennium Received: from X.X.X.X (unknown[X.X.X.X](misconfigured sender)) Thanks! -- NC Beach Bum And they are SPAM, right? Exchange 2003 allows you to filter messages that have a Blank sender. If you want to do this, you must enable it in 2 places. First, under Glo...

How do I make the X-Axis increase in scale with the quantity?
For example: If I have the values 1.5, 3.5, 8.7, 9.9 in the x values for a line graph, is there anyway to make them spaced apart so that they are in scale with eachother... Like so the distance between 3.5 and 8.7 is larger than, the distance between 1.5 and 3.5? Create a XY Scatter chart. It, and a bubble chart, are the only 2 that allow for cardinals values on the x axis. -- Regards, Tushar Mehta www.tushar-mehta.com Excel, PowerPoint, and VBA add-ins, tutorials Custom MS Office productivity solutions In article <F2D3DC58-86D3-4D21-9D57-F704A78941FB@microsoft.com>, =?Utf- 8...

how do you make all incoming emails bold?
"Beth" <Beth@discussions.microsoft.com> wrote in message news:CD76AE42-9EC9-44C8-90FB-3A0566671AC4@microsoft.com... > I could've sworn there was a message here, but when I looked the body was completely blank. Oh well, guess the poster really didn't want to ask a question. how do you make all incoming emails bold? "Vanguard (NPI)" wrote: > "Beth" <Beth@discussions.microsoft.com> wrote in message > news:CD76AE42-9EC9-44C8-90FB-3A0566671AC4@microsoft.com... > > > > > I could've sworn there was a messag...

Pivot table page field problem
I have set up a pivot table with a page field for account name. I'm having a problem where I select an account from the page field drop down box, but when the pivot table updates, some of the time it shows data for a different account. For instance, if I select Supplies, the page field will show Supplies after my choice, but if I double click on a cell in the table itself, the resulting data is for Travel expense. It's not consistently wrong, just sometimes. Has anyone else had this problem, and if so, how did you fix it? Perhaps some of the captions were accidentally changed. You...

How to make VLOOKUP work for this
I have a "master" spreadsheet where column A is a time column and every row represents a second (in plain text format) such as 00:00, 00:01, 00:02.... 00:59:, 01:00, 01:01, 01:02,... and continues on for 24 minutes... 23:59, 24:00. (1442 rows). Off to the side (I'm thinking of putting it on another sheet though) I have a small table where I'll enter the time and corresponding data I need populated in Column B, and will look something like the following example; My question(s) are, is the VLOOKUP function the best way to populate column B with the values? It's ...

Word Merge access hyperlink fields.
This is for Albert Kallal or anyone familiar with his Easy Word Merge file. I am a new user to access and have created my first database. I have downloaded and am using Albert Kallal's single word merge. I am having a problem now with hyperlink merge fields as they are displayed as an address and not a hyperlink . I would also like to know how I can merge more than 1 record to a single word document. I have based my form on a query with multiple tables, but when the form is merged only the first record in the query is displayed! Many Thanks. -- Lyndy ...

Make Personal Calendar Read Only
I would like to make a users personal calendar read-only to the user. The individuals calendar is delegated to about 5 others and they need full access, but I do not want the end-user to have full access but read only. How do I go about changing these permissions? Thanks, Brian I don't believe that is even possible through the standard means, it is a little bizarre. You may be able to do it through a tool like ADSIEdit. Nue "HoosierDaddy" <bjorgenson@charter.net> wrote in message news:1139250053.396235.106790@o13g2000cwo.googlegroups.com... >I would like to make a...

How do I make more than 12 entries in excel balance sheet templat.
The excel balance sheet template is exactly what I need. How do I get it to expand to an infinite number of entries?? office xp ...

RM10301 field electronic
1) what is this field (electronic) in RM10301 used for? 2) we import trx into RM_SALES_WORK and would like to have a way to mark such records to distinguish from manual entered trx, can this field (electronic) be used? or is there any better way? thks in advance According to the SDK, it's a flag to indicate the transaction is electronic. I also went through the Dynamics source code and could not find any references to this field, but I am not advocating that it's safe to use. NOTE: The field Electronic is widely used in Payables Management tables and scripts, so there may be...

Is it Possible to make a table from a query without a Make Table Q
Is it possible to make a table with a query as the record source, without using a Make Table Query. The reason that I as is that I have a rather large database that I use to create tables for each day of the month based on activity recieved from a larger database. I use one Pass-Through query as the source for 31 Make Table queries. The reason I have done this is because I need to segregate the activity by date so that I can produce daily averages over the entire month. The reason that I have had to break each one per day is the Pass Through query is huge (returning 7,000,000 + rec...

OL 2003 Notes text field
Just curious...is there a limit to the amount of data one can enter into the general text notes field in an OL2003 Contact record? Not sure but I have been told 999 characters (including spaces) --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. All unsolicited mail sent to my personal account will be deleted without reading. After furious head scratching, Bob Igel asked: | Just curious...is there a limit to the amount of data one can enter | into the general text notes field in an OL2003 Contact record? ...

Making a bmp transparent
Using Publisher 2000 Windows 98SE Is it possible to make a graphic file transparent? I'm attempting to create a motivational cartoon and would like to have a couple of scenes in the background. To do this I think I need to make an image file transparent. Can it be done? I have Paint Shop Pro and MS Paint. I have the challenge in the file, "Problem.zip" which can be downloaded at: http://www.tinyurl.com/wifs On the "Odds, Ends & Funny Things page. Click on the Snowman. 'Appreciate the help. -- Don -------- Vancouver, USA - One of the great cities in one of...

Update multiple fields in table from form
access 2003 optCTorSTorGEN is an option group on the main form fWarrantyUnit. If there is a change in the selection of the opt group, I would like 3 fields in the subforms table, set to Null where WarrantyUnitID = strWarrantyUnitID the subform is fWarrantyDetails and is a continuous form so the fields will need to be set for each recordset where WarrantyUnitID = strWarrantyUnitID The fields are optHPorIPorLP, BB1 and BB2 and are all Numeric. Private Sub optCTorSTorGEN_AfterUpdate() strWarrantyUnitID = WarrantyUnitID.Value CurrentDb.Execute "UPDATE...

How to make Frames??
how to make frames in microsoft publisher??? You use the Tool called TEXT FRAME Pretty easy I would have thought - obviously a challenge for some. -- i try to find in tool section.. but there is no button called TEXT FRAME? can u tell me the steps! PLZ!! Thankx.. and one more question.. i would link some sites... but i want that link(site) to be pop up in new window.? how to do it??? i've been trying to find it.. but then it always pop up in same window.. and could u tell me the steps?? plz. Thanzk Trust me, there is most definitely a button called Text Frame. Look in the HEL...

How to make this report simple? Thanks
How to combine all items to be read better? I mean just now I have 3 products however to each of theme are the same items / Rqst, EG, SP, EG-SP/ and I would like to meka it simplier. July2006 August2005 Group1 Group2 Group3 Group1 Group2 product1 Rqst 4301 0 250 120 75 EG 3560 0 150 80 100 SP 3200 0 120 40 50 EG-SP 360 0 65 30 200 product2 Rqst 100 150 EG SP EG-SP product3 Rqst EG SP EG-SP Thanks a lot for any kind of info. Juraj / mer68@zmail.sk ...

Pivot Table calculated field error
I have a calculated field in a pivot table in Excel 2007 that averages the selling price of an item. The Columns are the years from 2008 to present, Row Labels are items then by Customer Type, and the values are Quantities Sold, Total Dollar Amount and the calculated field is the average selling price (Dollars/Quantity). The problem is that each item is not sold for every year and I get Div/0 error. When I try the following =if(Dollars<>0, Dollars/Quantity,"") the #value error replaces the Div/0 error. I looked at the Contexture website and didn't find any ide...

making lines around info so it looks like a table when printed or viewed
Version: 2008 Operating System: Mac OS X 10.4 (Tiger) How do I put horizontal and vertical lines around all the cells so it looks like a table? Display the Toolbox by hitting the Toolbox button. Activate the Formatting Palette (upper left button) then chose Borders and Shading. Make sure you select the cels you want to format.... <br><br>make your choice in de button that has &quot;type:&quot; in front of it. Done Thank you I have been successfully making borders in all my excel worksheets but since the latest update, the palette in excel no longer works. At firs...