This topic is locked

Disable editing field after it was added

11/14/2005 10:19:46 AM
ASPRunnerPro General questions
orit author

In my database, one user add records directly through the MS-Access interface. On the web, with the help of ASPRunner, I display all the records and would like the rest of the users to insert value to one of the fields - through the web interface.

I thought to do that by adding the edit option for each record with one field to edit - this is the field that the rest of the users insert.

I want that after this field has a value, it can't be edited any more. how can I do, that if the field is empty - to place beside the record link to "Edit" the record (means to update this field) and if the field is empty - not to place the link to the edit page so the change of the field will be not possible?
Thanks a lot

Sergey Kornilov admin 11/14/2005

You can modify list page for this purpose. See my changes in bold.

if strOwnerID<>"" then strOwnerID = rs(strOwnerID)

if CheckSecurity(strOwnerID, "Edit")=True and rs("FieldName")="" then


Replace FieldName with the actual field name.

orit author 11/17/2005

Something doesn't work for me with that.

The field is in "Short Date" format, Is it possible that this is the reason? If yes, How to do that?

And if not - what may be the problem?
Thanks

Sergey Kornilov admin 11/17/2005

Are you saying you use date field as an OwnerID?

orit author 11/17/2005

No, other field. The format of the field that shouldn't be edited is a short date

The result in my code is:

if strOwnerID<>"" then strOwnerID = rs(strOwnerID)

if CheckSecurity(strOwnerID, "Edit")=True and rs("CDD")="" then



The field CDD is a short date.

Following that code the link to the Edit page is not displayed anywhere...
What can be the reason?
Thanks

Sergey Kornilov admin 11/22/2005

If code above doesn't work try this one:

if strOwnerID<>"" then strOwnerID = rs(strOwnerID)

if CheckSecurity(strOwnerID, "Edit")=True and IsNull(rs("CDD")) then


If this doesn't work - tell me what exactly happens.

orit author 11/23/2005

Perfect,

Thanks a lot