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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Identify a Memo Field

Status
Not open for further replies.

vich

Technical User
Sep 26, 2000
107
US
I been researching and researtch and can not figure out how can I determine if a source of textbox control is a memo field? Whenever I probe the controltyoe I get 109 for all textbox controls whether it a memo or text field.

Many Thanks for any assistance.
 
You need to check the field attributes 32770 is a memo.
 
Well, 109 is acTextBox (as expected).
There is no control of type memo.
Only a field may be of type memo (dbMemo = 12)

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I had that the wrong way around, thanks for the prompt, PHV. Both Hyperlink and Memo fields are type 12, but a Memo field has an Attribute 2, whereas a Hyperlink has an Attribute 32770.
 
Ok, thanks. now for the dumb quesiton How do I reference the field and its type?
Thanks
 
Have a look at the DAO.Fields collection.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Ok one more question though. I am trying to determine this on a bound form in Access 2k3. I am trying to use Michael Red's Transaction Log in the FAQ's to back up changed fields. But since memo fields are edited through textbox controls I can not figure out how to determine if the controls datasource is a memo field to copy it to a memo field verses a test field.

For Each MyCtrl In frm.Controls
If (basActiveCtrl(MyCtrl)) Then 'Consider replacing w/ test for "ControlSource"
' Debug.Print MyCtrl.Name, " ", MyCtrl.ControlType
If ((MyCtrl.Value <> MyCtrl.OldValue) _
Or (IsNull(MyCtrl) And Not IsNull(MyCtrl.OldValue)) _
Or (Not IsNull(MyCtrl) And IsNull(MyCtrl.OldValue))) Then
If (MyCtrl.ControlType = dbMemo) Then
Hist = "tblHistMemo"
Else
Hist = "tblHist"
End If
Call basAddHist(Hist, frm.Name, MyKey.Name, MyCtrl)
End If
End If
Next MyCtrl


I'm really stuck so the help is really appreciated.

Thanks
 
You may consider playing with the Tag property of the control to instruct your log routine ...

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I can do that.

Many thanks for the feedback. I wasn't sure if I was overlooking something.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top