?
Solved

"Variant does not contain a container" error

Posted on 2006-05-16
10
Medium Priority
?
489 Views
Last Modified: 2013-12-18
I  am getting an "Variant does not contain a container" error. How do I give my new code a container, just want to help it out. :>)

Sub Click(Source As Button)
     Dim s As New notessession
     Dim db As notesdatabase
     Set db = s.currentdatabase
     Dim ws As New notesuiworkspace
     Dim uiDoc As notesuiDocument
     Set uiDoc = ws.currentdocument
     Dim tmpArr As Variant
     
     Call s.SetEnvironmentVar("WindowSizePickKeywords", "171 142 736 553", True)
     tmpArr = ws.PickListstrings( 3, False, db.server , db.fileName , "PayrollTitles" , "Payroll Titles" , "Please choose a payroll title for this user.", 1, "")
     Call uiDoc.fieldsettext("payroll_title", tmpArr(0))
     
End Sub
0
Comment
Question by:jforget1
10 Comments
 
LVL 63

Expert Comment

by:SysExpert
ID: 16691684
On what line is the  error occurri ?

Have you run this in  debug Mode ?

I hope this helps !
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 16691693
Some suggestions:
- you do this in a document that's open for editing??
- use db.FilePath, not db.FileName
0
 

Author Comment

by:jforget1
ID: 16691704
Sorry, forgot to add that, it is happening at the line below. Maybe because there is nothing to put into the field.

Call uiDoc.fieldsettext("payroll_title", tmpArr(0))
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:jforget1
ID: 16691725
" you do this in a document that's open for editing??"

Yes it is in edit mode.
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 16691741
tmpArr(0) may not have value.
so.. before Call uiDoc.fieldsettext("payroll_title", tmpArr(0)) this, add..

if (isempty(tmpArr)) then
msgbox "Please select value"
exit sub
end if
0
 

Author Comment

by:jforget1
ID: 16691776
What if they just want to cancel and not choose a value, will this code help that.
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 16691785
yes..it will help
0
 

Author Comment

by:jforget1
ID: 16691848
I added the code suggested but still get the error when hitting cancel, do I have this in the proper place?

Sub Click(Source As Button)
      Dim s As New notessession
      Dim db As notesdatabase
      Set db = s.currentdatabase
      Dim ws As New notesuiworkspace
      Dim uiDoc As notesuiDocument
      Set uiDoc = ws.currentdocument
      Dim tmpArr As Variant
      
      Call s.SetEnvironmentVar("WindowSizePickKeywords", "171 142 736 553", True)
      tmpArr = ws.PickListstrings( 3, False, db.server , db.filePath , "PayrollTitles" , "Payroll Titles" , "Please choose a payroll title for this user.", 1, "")
      Call uiDoc.fieldsettext("payroll_title", tmpArr(0))
      If (Isempty(tmpArr)) Then
            Msgbox "Please select value or Cancel"            
            Exit Sub
      End If
End Sub
0
 
LVL 19

Accepted Solution

by:
madheeswar earned 2000 total points
ID: 16691867
Try this:

Sub Click(Source As Button)
     Dim s As New notessession
     Dim db As notesdatabase
     Set db = s.currentdatabase
     Dim ws As New notesuiworkspace
     Dim uiDoc As notesuiDocument
     Set uiDoc = ws.currentdocument
     Dim tmpArr As Variant
     
     Call s.SetEnvironmentVar("WindowSizePickKeywords", "171 142 736 553", True)
     tmpArr = ws.PickListstrings( 3, False, db.server , db.filePath , "PayrollTitles" , "Payroll Titles" , "Please choose a payroll title for this user.", 1, "")
If (Isempty(tmpArr)) Then
          Msgbox "Please select value or Cancel"          
          Exit Sub
     End If

     Call uiDoc.fieldsettext("payroll_title", tmpArr(0))
     End Sub
0
 

Author Comment

by:jforget1
ID: 16691904
This worked, I ended up taking out the MsgBox but the rest of the code worked. Thanks for the help.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question