run-time error 2176

G

Guest

I have a db that I use to track patient correspondances, its returns a
run-time error 2176, the setting for this property is too long, when trying
to use my date/time stamp after multiple uses for the same patient. I am
able to use the date/time stamp 11 times with notes for each entry then I get
the run-time error on the 12th time. I do not know how to remedy this error
can anyone help me with this problem?
 
G

Guest

This is what is highlighted when I say debug
Private Sub Command15_Click()
With Me.[Text10]
.SetFocus
.Text = .Text & vbCrLf & vbCrLf & Now (This line is highlighted)
.SelStart = Len(.Text)
.SelLength = 0
End With


End Sub
 
D

Dan Artuso

Hi,
Is there any reason you are using the Text and not the Value property?

--
HTH
Dan Artuso, Access MVP


Mike W said:
This is what is highlighted when I say debug
Private Sub Command15_Click()
With Me.[Text10]
.SetFocus
.Text = .Text & vbCrLf & vbCrLf & Now (This line is highlighted)
.SelStart = Len(.Text)
.SelLength = 0
End With


End Sub

Mike W said:
I have a db that I use to track patient correspondances, its returns a
run-time error 2176, the setting for this property is too long, when trying
to use my date/time stamp after multiple uses for the same patient. I am
able to use the date/time stamp 11 times with notes for each entry then I get
the run-time error on the 12th time. I do not know how to remedy this error
can anyone help me with this problem?
 
G

Guest

No, there is no reason I suppose. That is just how I got it to work using
the wizard to help.

Dan Artuso said:
Hi,
Is there any reason you are using the Text and not the Value property?

--
HTH
Dan Artuso, Access MVP


Mike W said:
This is what is highlighted when I say debug
Private Sub Command15_Click()
With Me.[Text10]
.SetFocus
.Text = .Text & vbCrLf & vbCrLf & Now (This line is highlighted)
.SelStart = Len(.Text)
.SelLength = 0
End With


End Sub

Mike W said:
I have a db that I use to track patient correspondances, its returns a
run-time error 2176, the setting for this property is too long, when trying
to use my date/time stamp after multiple uses for the same patient. I am
able to use the date/time stamp 11 times with notes for each entry then I get
the run-time error on the 12th time. I do not know how to remedy this error
can anyone help me with this problem?
 
R

Randy Harris

Mike W said:
This is what is highlighted when I say debug
Private Sub Command15_Click()
With Me.[Text10]
.SetFocus
.Text = .Text & vbCrLf & vbCrLf & Now (This line is highlighted)
.SelStart = Len(.Text)
.SelLength = 0
End With


End Sub

Mike, you're exceeding that capacity of a text box, which seems to be about
1900 characters.
 
L

Larry Daugherty

Hi Mike,

If you're exceeding some text limitation you might make the field type
"Memo". But I think that an even better way to go might be a re-design such
that these date/time stamped events are in their own table and that they are
child records to the patient master record.

HTH
--
-Larry-
--

Mike W said:
This is what is highlighted when I say debug
Private Sub Command15_Click()
With Me.[Text10]
.SetFocus
.Text = .Text & vbCrLf & vbCrLf & Now (This line is highlighted)
.SelStart = Len(.Text)
.SelLength = 0
End With


End Sub

Mike W said:
I have a db that I use to track patient correspondances, its returns a
run-time error 2176, the setting for this property is too long, when trying
to use my date/time stamp after multiple uses for the same patient. I am
able to use the date/time stamp 11 times with notes for each entry then I get
the run-time error on the 12th time. I do not know how to remedy this error
can anyone help me with this problem?
 
G

Guest

The form that this is on is a multiple page form that places the time date
stamp into a memo field. I can still type in the memo field even though I
can not hit the time date stamp. So if the stamp does not work I just type
in the time and the date and continue to document the notes. I just thought
that there might be some thing wrong with the button. All the time date
stamp does is place the time and date into the memo field.
Thanks for the responses
Does this shed any new light on the problem?

Larry Daugherty said:
Hi Mike,

If you're exceeding some text limitation you might make the field type
"Memo". But I think that an even better way to go might be a re-design such
that these date/time stamped events are in their own table and that they are
child records to the patient master record.

HTH
--
-Larry-
--

Mike W said:
This is what is highlighted when I say debug
Private Sub Command15_Click()
With Me.[Text10]
.SetFocus
.Text = .Text & vbCrLf & vbCrLf & Now (This line is highlighted)
.SelStart = Len(.Text)
.SelLength = 0
End With


End Sub

Mike W said:
I have a db that I use to track patient correspondances, its returns a
run-time error 2176, the setting for this property is too long, when trying
to use my date/time stamp after multiple uses for the same patient. I am
able to use the date/time stamp 11 times with notes for each entry then I get
the run-time error on the 12th time. I do not know how to remedy this error
can anyone help me with this problem?
 
L

Larry Daugherty

Hi Mike,

Set up one of your records to use just for test purposes. Keep adding time
stamps and notes until the thing burps. Go to the earliest text you entered
in the text box and delete the first couple hundred characters. Try it
again. If it now works for a while before it burps you've isolated your
problem as being the size of the .text. If not, you have more testing to
do. Also, one of the other responders asked why you were using .text rather
than .value. Have you tested the effect of using .value?

At any rate, I still recommend that you re-design your application to have a
new table to contain your time/stamped entities: tblTimedStuff (you'll
think of a much better name for your time/stamped events). You can use the
form/subform setup that is described in Access. You can sort your events
descending so that the most recent events are the first in view. It sounds
complicated (well, it is, actually) but Access makes it easy.

The down side of a re-design is that your existing large text/memo fields
would have to be manually broken down to fit the new parading such that each
old style entry now becomes a separate record. However, once that's done
you'll have lots of benefits:
You won't have to hit a button to insert the timestamp; once you have
pulled up the patient's record, you can just start typing the current event
into your new record. Because you'll have set the default value for the
timestamp to Now() it will go in automatically but you can over write it if
you choose.
You can more easily find a particular record because the records are
organized such that the same information always appears in the same place.
You can generate complete correspondence history reports that are well
organized and easy to read.

I suggest that you move a copy of your application off to a "sandbox" area
for experimentation. Try some of the new ideas.

HTH
--
-Larry-
--

Mike W said:
The form that this is on is a multiple page form that places the time date
stamp into a memo field. I can still type in the memo field even though I
can not hit the time date stamp. So if the stamp does not work I just type
in the time and the date and continue to document the notes. I just thought
that there might be some thing wrong with the button. All the time date
stamp does is place the time and date into the memo field.
Thanks for the responses
Does this shed any new light on the problem?

Larry Daugherty said:
Hi Mike,

If you're exceeding some text limitation you might make the field type
"Memo". But I think that an even better way to go might be a re-design such
that these date/time stamped events are in their own table and that they are
child records to the patient master record.

HTH
--
-Larry-
--

Mike W said:
This is what is highlighted when I say debug
Private Sub Command15_Click()
With Me.[Text10]
.SetFocus
.Text = .Text & vbCrLf & vbCrLf & Now (This line is highlighted)
.SelStart = Len(.Text)
.SelLength = 0
End With


End Sub

:

I have a db that I use to track patient correspondances, its returns a
run-time error 2176, the setting for this property is too long, when trying
to use my date/time stamp after multiple uses for the same patient.
I
am
able to use the date/time stamp 11 times with notes for each entry
then
I get
the run-time error on the 12th time. I do not know how to remedy
this
error
can anyone help me with this problem?
 
R

Randy Harris

Mike W said:
This is what is highlighted when I say debug
Private Sub Command15_Click()
With Me.[Text10]
.SetFocus
.Text = .Text & vbCrLf & vbCrLf & Now (This line is highlighted)
.SelStart = Len(.Text)
.SelLength = 0
End With

Mike, I can't explain why it happens this way, but I duplicated the symptom
you describe and was able to come up with a work around. When I stopped
assigning the value to the .Text propery, the problem disappeared. Change
your code to this:

Private Sub Command15_Click()
With Me.[Text10]
.SetFocus
Me.Text10 = .Text & vbCrLf & vbCrLf & Now
.SelStart = Len(.Text)
.SelLength = 0
End With

I think that will stop the error.
Randy
 
G

Guest

That seems to work. I made the change and it works at least for now. Thank
you very much.

Randy Harris said:
Mike W said:
This is what is highlighted when I say debug
Private Sub Command15_Click()
With Me.[Text10]
.SetFocus
.Text = .Text & vbCrLf & vbCrLf & Now (This line is highlighted)
.SelStart = Len(.Text)
.SelLength = 0
End With

Mike, I can't explain why it happens this way, but I duplicated the symptom
you describe and was able to come up with a work around. When I stopped
assigning the value to the .Text propery, the problem disappeared. Change
your code to this:

Private Sub Command15_Click()
With Me.[Text10]
.SetFocus
Me.Text10 = .Text & vbCrLf & vbCrLf & Now
.SelStart = Len(.Text)
.SelLength = 0
End With

I think that will stop the error.
Randy
 

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