disabling memo field when form is entered if there is data in fiel

G

Guest

I have two forms, frmDetails and frmDocumentation. FrmDetails has three text
boxes that house the received date, closed date, and outcome, and the control
source for frmdetails is tblDetails. There can be alot of documentation
logged regarding each record in tblDetails. Therefore, frmDocumentation
(subform of frmDetails) tracks the documenation. The control souce to
frmDocumenation is tblDocumentation. tblDetails and tblDocumentation have a
one-to-many relationship. FrmDocumentation consists of only one object, a
memo field, and this form's default view is continuous forms. Users may
document in the record initially, then maybe a day later document more. I
want their last documentation to be disabled, or "read-only" the next time
they go in to add new documentation (another memo field appears below the one
they are typing in). Any ideas on how I can do this? Thank in advance!
 
G

Guest

Add a Yes/No field to tblDocumentation. For example sake, I will call it
[DOC_COMPLETED]

Create a hidden text box on frmDocumentation. I will call it
txtDocComplete. Make the Control Source [DOC_COMPLETED]

Then in the After Update event of the memo field control on frmDocumentation:
Me.txtDocComplete = True

In the Current Event of frmDocumentation:
Me.txtMemoFieldName.Locked = Me.txtDocComplete
 
R

Ron2005

In the "On Current" event for the form,

if isnull(memofield) then
memofield.enabled = true
else
memofield.enable = false
endif
 
G

Guest

This worked - thank you!

Klatuu said:
Add a Yes/No field to tblDocumentation. For example sake, I will call it
[DOC_COMPLETED]

Create a hidden text box on frmDocumentation. I will call it
txtDocComplete. Make the Control Source [DOC_COMPLETED]

Then in the After Update event of the memo field control on frmDocumentation:
Me.txtDocComplete = True

In the Current Event of frmDocumentation:
Me.txtMemoFieldName.Locked = Me.txtDocComplete

wideawake said:
I have two forms, frmDetails and frmDocumentation. FrmDetails has three text
boxes that house the received date, closed date, and outcome, and the control
source for frmdetails is tblDetails. There can be alot of documentation
logged regarding each record in tblDetails. Therefore, frmDocumentation
(subform of frmDetails) tracks the documenation. The control souce to
frmDocumenation is tblDocumentation. tblDetails and tblDocumentation have a
one-to-many relationship. FrmDocumentation consists of only one object, a
memo field, and this form's default view is continuous forms. Users may
document in the record initially, then maybe a day later document more. I
want their last documentation to be disabled, or "read-only" the next time
they go in to add new documentation (another memo field appears below the one
they are typing in). Any ideas on how I can do this? Thank in advance!
 
G

Guest

This worked; however, I'm having a problem with the form now. This form is
made up of many subforms. frmDataEntry is the main form. frmPatients is the
first subform, frmDetails is a subform within frmPatients, and finally
frmMRAS and frmDocumentation are subforms within frmDetails.
Whenever I click on the Documentation texbox, either to update it or not,
when I then go to move to a new employee or a new patient, my frmDetails
subform disappears, leaving only frmDocumentation, frmPatients, and
frmDataEntry showing. Why do you think this is? Is my database design
wrong? I can zip it and email it to anyone who'd like to look at it.
Note: sometimes Access will ask me if I want to save changes to the design
of frmDocumentation when I'm not aware that I've made any changes. Any help
would be appreciated, thank you!

Klatuu said:
Add a Yes/No field to tblDocumentation. For example sake, I will call it
[DOC_COMPLETED]

Create a hidden text box on frmDocumentation. I will call it
txtDocComplete. Make the Control Source [DOC_COMPLETED]

Then in the After Update event of the memo field control on frmDocumentation:
Me.txtDocComplete = True

In the Current Event of frmDocumentation:
Me.txtMemoFieldName.Locked = Me.txtDocComplete

wideawake said:
I have two forms, frmDetails and frmDocumentation. FrmDetails has three text
boxes that house the received date, closed date, and outcome, and the control
source for frmdetails is tblDetails. There can be alot of documentation
logged regarding each record in tblDetails. Therefore, frmDocumentation
(subform of frmDetails) tracks the documenation. The control souce to
frmDocumenation is tblDocumentation. tblDetails and tblDocumentation have a
one-to-many relationship. FrmDocumentation consists of only one object, a
memo field, and this form's default view is continuous forms. Users may
document in the record initially, then maybe a day later document more. I
want their last documentation to be disabled, or "read-only" the next time
they go in to add new documentation (another memo field appears below the one
they are typing in). Any ideas on how I can do this? Thank in advance!
 
R

Ron2005

I can logically see where going to another patient could cause the
subforms to be empty if they are truely child forms and therefore
dependent on the parent (patient). Disappearing, though is not what I
would expect, unless it is simply the blank form there and no fields
showing because there is no record to show. The same thing will occur
if you have a full window form based on a query and it runs but there
are no records returned from the query.

Go ahead and send it. That is my home email, and I will try to look at
it over the 3 day weekend.

Ron
 
R

Ron2005

I sent emails back. I was unable to open the mdb. It gave an error
message about trying to get to an intranet and suggested putting the
mdb on a hard drive. I already was on my hardrive.

But Access refussed to open the file.

Ron
 
R

Ron2005

Well, I was finally able to open the file you sent me the second time.
I ended up opening it from the ZIP directory without saving it to a
special copy.
I got the forms to work and sent the mdb back to you last night, Hope
you got it.
Here are some comments I added to a "Read Me Form"

1) I changed the after update for the txtnumber field

2) I added the horizontal bars, but that may not have been necessary.
I was worried about the middle sub form and seeing all of the data.

3) I changed all the subforms to be dataentry and then changed them all
back and that seemed to make the biggest difference AND THEY WORKED
AFTER THAT.

4) I had to comment out the on current event for the documentation form
once the other part started to work. Probably should be on the after
update of the txt field. but that will overwrite what ever is there, so
I am not sure you even want to do that at all.

5) I would suggest NOT using the format for the date, because then the
person have to put in ALL 8 characters. If you change the format to
short date, which I did here, it will work just like an excell
spreadsheet date field.... a month a slash and a day will default to
this year.

6) I suggest making a small table for each of those dropdowns , and
forms to maintain them, that way all you have to do is add it to the
table and the form takes care of itself. If you end up having more
forms that have those dropdowns then you don't have to remember where
they all are later on when they change - people leaving etc..

7) the disappearing forms was because of not allowing adds but am not
sure what caused it to be off and then back on.

8) You might make sure that the vertical scroll bars are not on top of
one another, It makes it difficult to navagate if that is the case. And
that is part of why I added the horizontal bar. You may have to make
the fields smaller to get everything in in the form size. Particularly
with the documentation subform.

9) Somewhere as I was going through the forms I found a filter field
and took it out. But I could not find it on the original so I may have
added it myself by accident.

And these I thought of this morning while in the shower:
10) I believe there is a way to make icons etc internal instead of
through an external link. Because I was running it from a location
other than the original I got error messages whenever I opened the form
in both edit and run mode. If you make them internal then when you move
it to production you do not have to go around and find all the
locations / forms that have the icons and change the references. So
Make them internal and no changes will need to be done when moving it
to production or to another production site.

11) Make the mappings to the tables etc (and even icons) in a
HTTP/Server format as opposed to drive letter format. That way it will
work even on someone's system that has different drive mappings.

Hope all of this helps.

Ron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top