Hi,
However I designed my first form including a CommandButton which should paste a text into a TextBox (I programmed this function in the VBScript Editor). If I am working in the Developer Mode and click on "Run This Form", the function works properly.
However if I open the form and directly click on the CommandButton (without
entering the Developer Mode and clicking Run This Form") or if I send the
Form, it doesn`t work anymore.
This is the Code I use:
How can I make the CommandButton work ALWAYS????Code:Sub CommandButton2_Click() Dim RequestID Dim Tower Dim Subject Dim Datum 'get control items Set RequestID = Item.GetInspector.ModifiedFormPages.Item("Request for Change").Controls("RequestID") Set Tower = Item.GetInspector.ModifiedFormPages.Item("Request for Change").Controls("Tower") Set Subject = Item.GetInspector.ModifiedFormPages.Item("Request for Change").Controls("Subject") Set Datum = Item.GetInspector.ModifiedFormPages.Item("Request for Change").Controls("Datum") RequestID.Value = "DE1-HBM02-IMS-" & Year(Date) & Month(Date) & Day(Date) & Hour(Time) & Minute(Time) Subject.Value = "Request for Change " & RequestID.Value & " " & "<" & Tower.Value & ">" Datum.Value = Day(Date) & "." & Month(Date) & "." & Year(Date) End Sub
Did you publish the form to your Personal Forms library? Code runs only on published forms.
ExlGuru
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks