Memo Field

B

Bruce

I have a form in Justified mode and it contains a Notes box Formatted as
Memo,as it has to be printed on one A4 size with all entered text visible is
there any way I can restrict the text allowed in this field to 600
characters


Best Wishes
Bruce
 
S

Steve Schapel

Bruce,

You can put code like this on the Change event of the textbox...
If Len(Me.YourMemoField.Text) > 600 Then
MsgBox "Stop"
End If
 
B

Bruce

Thanks for your reply, but can you explain in more detail.
Where exactly do I enter the code,is Me the name of the form & Notes would
be the "Your Memo Field"

Thanks Bruce
 
S

Steve Schapel

Bruce,

In design view of the form, right-click on the Notes textbox, and select
Properties from the popup menu that appears. In the Property sheet,
locate the On Change event property. In this box, select [Event
Procedure] from the drop-down list, and then click the little button to
the right with the ellipsis [...] icon. This will open the Visual Basic
Editor window, with something like this already shown there...
Private Sub Notes_Change()

End Sub

You would type the code I suggested in the gap, so the whole procedure
looks like this...
Private Sub data_Change()
If Len(Me.Notes.Text) > 600 Then
MsgBox "Stop"
End If
End Sub

Close the VBE window, close and save the form. You might want to change
the 600 to a smaller number temporarily, so you can test it would having
to enter 600 characters into the Notes textbox before you can see
whether it is working :)
 
B

Bruce

Hi Steve, Thanks for your help it worked a treat.

What are your thoughts on this, I have created a Report and the boss wants
in the footer A calculation to find the percentage of two fields "Projects
Opened" "Cases Settled". The trouble is that "Projects Opened" is text and "
Cases Settled" is numeric. Any ideas.

Thanks Bruce
Steve Schapel said:
Bruce,

In design view of the form, right-click on the Notes textbox, and select
Properties from the popup menu that appears. In the Property sheet,
locate the On Change event property. In this box, select [Event
Procedure] from the drop-down list, and then click the little button to
the right with the ellipsis [...] icon. This will open the Visual Basic
Editor window, with something like this already shown there...
Private Sub Notes_Change()

End Sub

You would type the code I suggested in the gap, so the whole procedure
looks like this...
Private Sub data_Change()
If Len(Me.Notes.Text) > 600 Then
MsgBox "Stop"
End If
End Sub

Close the VBE window, close and save the form. You might want to change
the 600 to a smaller number temporarily, so you can test it would having
to enter 600 characters into the Notes textbox before you can see
whether it is working :)

--
Steve Schapel, Microsoft Access MVP

Thanks for your reply, but can you explain in more detail.
Where exactly do I enter the code,is Me the name of the form & Notes would
be the "Your Memo Field"

Thanks Bruce






visible is
 
S

Steve Schapel

Bruce,

Can you please give me an example of how this woudl work? On the face
of it, I don't understand the concept of a percentage of text...
 
B

Bruce

Hi Steve,

The boss came up with this idea to impress the senior management, but I've
been give the task. We have a large (6000 cases) database that is used by 40
people every day, they enter into it individual cases that are appropriate
to predetermined list of Projects (this the text bit) then when a case is
closed the length of time (in months) is entered (numeric).The boss wants to
know what percentage the settled cases represented by length of enquiry is
of the total number of cases within each project. Well I got the report to
add up various data within each project but the percentage bit is stumping
me.

So I have =Count([Project Type]) also another =Sum(Abs([Length of Enq
(Mths)]>0))

So if I have say 20 cases totalled in Project Type and say 5 are settled as
shown by the Length of Enq (Mths) then in theory the answere would be 25%.

But how?

Thanks Bruce
 
S

Steve Schapel

Bruce,

Well, I would say in exactly the same way that you got the 25% in your
example... you divide one by the other. In other words...
=Sum(Abs([Length of Enq (Mths)]>0))/Count([Project Type])

Is that what you mean?
 

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