Inserting Data From A Database Into A User-Defined Field

  • Thread starter Thread starter Rob
  • Start date Start date
R

Rob

I have added a field to a Contact form in Business Contact Manager called
Test Field.

The issue I am having, concerns when I try to insert data from a database
into the field using a piece of VBScript.

My code to insert the content is:

if isnull(objrs("Member Name")) = false then .TestField = objrs("Member
Name")

I am wondering if it is the name of the field I am looking up in the form
(.TestField) and whether or not this is the correct VB name for the field,
Test Field.

If this is the case how do I find out what the VB name is for user-defined
fields?

Any advice would be much appreciated
 
Thanks for that, so including that code, would the line of code read

if isnull(objrs("Member Name")) = false then myContact.UserProperties("Test
Field") = objrs("Member Name")
 
I'm not sure that makes sense. If Member Name is Null, why bother getting the value twice, why not just:

If isnull(objrs("Member Name")) = false then
myContact.UserProperties("Test Field") = ""
End If

For readability, I wouldn't do it in one statement.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
 
Back
Top