Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Memo Field Problems

Status
Not open for further replies.

chad4828

IS-IT--Management
Jul 8, 2003
13
0
0
US
I'm trying to get a checkbox to check or uncheck depending on if there is information in a memo field. This is what I've done so far.

I have a single check box bound to field [e]. I have a memo field bound to field [except]. I've created a macro "e" with a condition of IsNull([except]) and a SetValue Argument with the item as [e] and an expression of "0" with out the quotes. It doesn't work. However if I change the data type of the memo field to a Text field it works. Unfortunatly the text box field only displays 255 characters and I need much more than that.

Any suggestions on how to get this to work with a memo field?
 
I try to get everyone to stay away from Macros. Here is a piece of code that works great within the code behind the form. If you've never used code before, this triggers on the AfterUpdate event of the [Except] memo field. I believe the difference lies in the use of Len()=0 as opposed to IsNull().

Code:
Private Sub Except_AfterUpdate()
  On Error Resume Next
  If Len(Me.Except) = 0 Then 
    Me.e = False 
  Else 
    Me.e = True
  End If
End Sub

Take care,
--Shaun

"I wish that my room had a floor; I don't care so much for a door.
But this crawling around without touching the ground is getting to be quite a bore!" -- Gelett Burgess
 
Thanks! SMerrill! It works "sort of". When a change is made to the memo field the Checkbox doesn't update until you go to a different record and then go back. For some reason it's not updating like it should. Any suggestions?
 
You could try the code in the 'Exit' event, rather than (or even as well as) the 'Afterupdate' event, the 'Exit' event will fire when you move the cursor out of the memo field into another form field.
 
Hey! It worked without having to code the on exit. When I first tried the code i tried it on a sample database with the same fields but it wasn't working right. As soon as I got back to work and tried it on the real database it worked like a charm thanks for your help SMerrill!!!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top