Can someone tell me why I get a “Type Mismatch” error on the pickliststring line? the prompt works fine. I’ve attached the code…
Sub Click(Source As Button)
Dim w As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim Client As Variant
Dim response As Variant
Dim values(5) As Variant
values(0) = "SS Mileage"
values(1) = "Other Mileage"
values(2) = "Lunch"
values(3) = "HW/SW"
values(4) = "Parking"
values(5) = "Miscellaneous"
response = w.Prompt (PROMPT_OKCANCELLIST, "Select an Expense Type", "Select an Expense Type.", values(0), values)
If Isempty (response) Then Exit Sub
Set Client = w.PickListStrings(PICKLIST_CUSTOM,True,"mercury/Walker", "ClientServices\CLIENT95.nsf", "Active Clients \ Systems Support Only", "Client List", "Please select a Client","1","")
If Isempty (Client) Then Exit Sub
Set uidoc = w.CurrentDocument
uidoc.Document.FieldValue0 = response
uidoc.Document.FieldValue2 = Client
Call uidoc.Refresh
End Sub
Thanks for the help!
Subject: PickListStrings
Probably because you’ve set the column number as a string - remove the quotes around the “1” and it should work.
Also, you’ve set a category name of “” - I assume you just don’t want to limit it to a category so leave the parameter out.
Dan
Subject: RE: PickListStrings
I removed the quotes around the "1) and I still get the Type Mismatch error. Could it have something to do with this line:
uidoc.Document.FieldValue2 = Client
Subject: RE: PickListStrings
Emily’s right about the set issue, I missed that - and I thought you said the error occurred at the PickListStrings line?
The line you mention now though would give the same error though, you need to reference the array value returned so use:
uidoc.Document.FieldValue2 = Client(0)
Dan
Subject: RE: PickListStrings
Even adding the (0) at the end of uidco.DocumentFieldValue2 = Client(0) does not fill in the field, it remains blank.
Any other suggestions?
Subject: RE: PickListStrings
Have you tried just using call uidoc.fieldsettext(client(0))?
It would be more ‘normal’
Dan
Subject: RE: PickListStrings
That didn’t work either…This is getting frustrating.
Subject: RE: PickListStrings
Have you been through this with the debugger to see what value you get from the pickliststrings - that should give you some more info.
Also, what type of field is FieldValue2? Is it computed, or does it have a translation formula?
Dan
Subject: PickListStrings
Hi Laura,
Do you need the ‘Set’ on the pickliststring line? Try taking away the set and see if you still get the error. PickListSTrings returns a string array and you don’t need Set when you build one manually.
Emily.
Subject: RE: PickListStrings
Thanks Emily, I no longer get the Type Mismatch error but my FieldValue2 doesn’t fill in the choice from my client pickliststring.Is this line correct?
uidoc.Document.FieldValue2 = Client