Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / November 2006

Tip: Looking for answers? Try searching our database.

Locked fields after submit

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
erick-flores - 07 Nov 2006 17:10 GMT
Hello all

I am having a lil of a problem here. This is what I have: A expense
report interface, employees enter their expense information press a
button and submit the report to their manager/accounting. I want to
locked all the fields once the employees submit their reports. They
will be able to see their submitted information but wont be able to
change it (once their submit the report).

I tried using the "locked" option behind my submit button. So I will
say, for example, field = locked But then when the employee re-enter to
the form and try to enter their expenses (new report) it will not let
him because the fields are locked and if I set the load event (for the
form) to unlocked the fields then they will be able to change their old
reports. You know what I mean? It is kinda confusing and I dont know
how to fix this problem

Any ideas???

Thanks in advance
Joan Wild - 07 Nov 2006 18:03 GMT
Add a yes/no field to your table.  When they submit the report update this
field to True.

Then you can change the allow edits, allow deletions property for the form
to No, if the value of this field is true.

You would set these properties in the current event for the form.

Signature

Joan Wild
Microsoft Access MVP

> Hello all
>
[quoted text clipped - 16 lines]
>
> Thanks in advance
erick-flores - 07 Nov 2006 20:34 GMT
> Add a yes/no field to your table.  When they submit the report update this
> field to True.
[quoted text clipped - 7 lines]
> Joan Wild
> Microsoft Access MVP

Thanks for your answer that looks like it should correct my problem.
But I am having trouble writing the right code. Can you please give me
more details of the actual code I need to put behind my forms.

I have a form(A) and a subform(B). A has the button that submit the
report, B has the expense information.

How do I modify a subform from a form? this is what I tried:
Forms![Expense Reports Subform].Yes_No_field.Enabled = True
And its not working, what I am doing wrong?

Thank you
Joan Wild - 07 Nov 2006 20:51 GMT
Include in the code to open the report.
Me![YesNoField] = True
Me.Dirty = False
DoCmd.OpenReport etc.

In the current event for the main form:
If Me![YesNoField] = true then
Me.AllowEdits = false
Me.AllowDeletions = false
else
Me.AllowEdits = True
Me.AllowDeletions = True
End If

Signature

Joan Wild
Microsoft Access MVP

>> Add a yes/no field to your table.  When they submit the report
>> update this field to True.
[quoted text clipped - 20 lines]
>
> Thank you
erick-flores - 07 Nov 2006 21:25 GMT
Thanks for your help, that code with a few changes did it.

I have a final question. Everything is working fine, but it is only
checking (the yes/no field) one of the records. This is kinda what I
have:

Expense Date     Expense Category       Description      Reimb   Co.
Paid    YesNoField
2/2/2002                Business Dev           testing
23.34                        (+)
2/3/2002                Meal                        testing
              34.34          (  )

I press the submit button and...
It will check the record that is selected but it will not check all the
records-all the expenses, you know what I mean? In the example above it
only check (the YesNoField) the first record. So my question is How do
I checked all the records at the same time?

Any ideas? Thank you
Joan Wild - 07 Nov 2006 22:14 GMT
I was thinking you'd put the yes/no field in the main form's recordsource -
afterall the 'submitted' applies to it doesn't it?

Signature

Joan Wild
Microsoft Access MVP

> Thanks for your help, that code with a few changes did it.
>
[quoted text clipped - 16 lines]
>
> Any ideas? Thank you
erick-flores - 07 Nov 2006 22:44 GMT
Finally got it to work. Thank you very much!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.