In my report, i need to display the current date in Prompting text box and also select from the LOVs(this is pretty simple) based on that, the values are fetched from the database.
how can we do this??
if any help that would be very greatful…
I don’t know if you can fill in default values in prompts. I would solve this using the Document_BeforeRefresh event in VBA. In VBA you could loop through the variables. Once you find the prompt asking for the date you fill in the current date.
Private Sub Document_BeforeRefresh(Cancel As Boolean)
For i = 1 To ActiveDocument.Variables.Count
If ActiveDocument.Variables.Item(i).IsUserPrompt = True Then
If ActiveDocument.Variables.Item(i).Name = "Date ?" Then
ActiveDocument.Variables.Item(i).Value = Date
End If
End If
Next i
End Sub
If you refresh this report the current date will be filled in at the ‘Date ?’ prompt.
[Edited, when posting code samples please use the code option for formatting. It will preserve any indenting or formatting that you may have done. Thank you, Andreas.]