Hi all, I’m new to lotus notes… First time using subforms…If anything wrong, plz guide me using it.
I have a field in my form(response) which gets numbers into it from a configuration form(parent).Based on the numbers in the field, I want to populate computed subforms. I wrote the formula as
@if(@GetField(sect_name)=1";“Section1”;“”) in the default value of the subform,I’ve enabled the “Insert formula” option in the subform properties…
I think that your problem may be related to when the computed SubForm formula is evaluated. The formula is during the opening of the form (I think right after the QueryOpen event if my memory serves me right). So if you are populating the field after that point then the subform is not computed. Try the following:1. Open a new document and populate the Section field.
Close the document and re-open it.
Is the subform properly created?
If this is the case then you can some code to set the field then close teh UIDoc and re-open it. This usually just causes the screen to flash for a moment.
Here is a code snippet that I have used to do soething similar to that.
Call current_doc.computewithform(True, False)
Call UI_Workspace.SetTargetFrame(“”)
Set new_uidoc= UI_Workspace.editdocument(True, current_doc)
current_uidoc.document.saveoptions = “0”
Call current_uidoc.close
'refresh the document
Call new_uidoc.reload
new_uidoc.refresh
You could hang this on a button that would call for the user to enter a Section number then store that in the appropriate field then call this sort of code. all it is doing is setting two instances of the same document in the UI then closing the older one and opening the newer one. May take a bit of playing with when you do the Section selection but so long as the right section # is in the New_UIDoc before it is reloaded it should work OK.
I mus thank all for the great response… I tried Tim’s n got it …I made a simple mistake in all the fields of the subforms… I’ve written hide-when in all the fields of the subforms… I forgot to remove those when i copied into the subforms…