Skip to main content
 
developerWorks
AIX and UNIX
Information Mgmt
Lotus
New to Lotus
Products
How to buy
Downloads
Live demos
Technical library
Training
Support
Forums & community
Events
Rational
Tivoli
WebSphere
Java™ technology
Linux
Open source
SOA and Web services
Web development
XML
My developerWorks
About dW
Submit content
Feedback



developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 4 and 5 Forum

Notes/Domino 4 and 5 Forum

developerWorks

  

Sign in to participate PreviousPrevious NextNext

Object variable stuff again - i have tried!
D Johnson 13.Feb.06 04:29 PM a Web browser
Domino Designer -- LotusScript Release 5 Windows XP

OK .. i know this has been the topic of much debate and many questions. I have looked thru many of the posts about it and have tried to play around with the code i have.
The short of it is ... i am new to this and dont understand how i am supposed to correct the error.

I have attempted to make a supplier database for work.
In the main form, I figured it would be a good idea to enter a supplier number and auto-populate the supplier name, address, phone etc based on the number.

The plan was to have Notes allow the end user to fill in this info the first time, and every time there-after it would pull the information from a previously created document.

From what I read, GetDocumentByKey seems the way to go here ... and get the info from the 'Vendors' view.
I started by having the SupplierNum field 'Exiting' event populate only the SupplierName field to see if i could get it working, but i am getting 'Object variable not set' error.

The Vendors view has the following sorted named columns:
Number Name Address Phone Fax Contact

Here is my code:




Sub Exiting(Source As Field)
Dim workspace As New NotesUIWorkspace
Dim session As New NotesSession
Dim uidoc As NotesUIDocument
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
Dim vNum As String

' first get the supplier number from SupplierNum field - this is set as a text field
Set uidoc = workspace.CurrentDocument
vNum = uidoc.FieldGetText( "SupplierNum" )

' now use the number as the key
Set db = session.CurrentDatabase
Set view = db.GetView( "Vendors" )
Set doc = view.GetDocumentByKey( vNum , True )

Call doc.FieldSetText _
( "SupplierName", doc.SupplierName(0) )
End Sub




According to debugger, it's the last line that is causing the problem:
( "SupplierName", doc.SupplierName(0) )

... and i'm sure it's doc.SupplierName coz i tried specifying it as a string with ""
But i can get it working as a variable ... obviously coz its not set!
But i'm a bit thick today .. so i dont see what its meant to be.

Would really appreciate yur help ..
Many thanks,

DJ




Object variable stuff again - i hav... (D Johnson 13.Feb.06)
. . RE: Object variable stuff again - i... (Stan Rogers 13.Feb.06)
. . . . RE: Object variable stuff again - i... (D Johnson 13.Feb.06)
. . . . . . RE: Object variable stuff again - i... (Stan Rogers 13.Feb.06)
. . RE: Object variable stuff again - i... (Stuart Bogom 13.Feb.06)
. . RE: Object variable stuff again - i... (Edgar Lins 14.Feb.06)
. . . . RE: Object variable stuff again - i... (Edgar Lins 14.Feb.06)
. . RE: Object variable stuff again - i... (Arshad Khalid 14.Feb.06)
. . . . RE: Object variable stuff again - i... (Stan Rogers 14.Feb.06)
. . RE: Object variable stuff again - i... (D Johnson 14.Feb.06)
. . RE: Object variable stuff again - i... (Nick Shennan 14.Feb.06)






  Document options
Print this pagePrint this page

 Search this forum

  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Author
Category
Platform
Release
Advanced search

 Sign In or Register
Sign in
Forgot your password?
Forgot your user name?
Create new registration

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds

 Resources
Forum use and etiquette
Native Notes Access
Web site Feedback

  Lotus Support
Lotus Support
Product support pages index
Search knowledge base (Technotes)
Search support downloads
Lotus Support RSS

 Wikis
IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
Notes/Domino 4 and 5
IBM Connections
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
IBM SmartCloud Meetings
IBM Web Content Manager
Lotus Domino Document Manager
Lotus e-learning
Lotus Enterprise Integration
Lotus Expeditor
Lotus Protector
Lotus Quickr
Lotus SmartSuite
Lotus Symphony
Lotus Symphony Developer Toolkit Support
Lotus Workflow