First off thanks for viewing my first question.
I had a form that was not connected to a database that used the following code form http://msdn.microsoft.com/en-us/library/aa942693(VS.80).aspx to get the current username in real time so that permission to fields could be controlled by the currrent user.
Public Sub FormEvents_Loading(ByVal sender As Object, ByVal e As LoadingEventArgs)
Dim root, user As System.Xml.XPath.XPathNavigator
root = Me.MainDataSource.CreateNavigator
user = root.SelectSingleNode("/my:myFields/my:employee", Me.NamespaceManager)
user.SetValue(System.Environment.UserName)
End Sub
Now I have a database that I want to use as a base for the form. Since I have created the database and need to submit and review data, I create the form from the database table. Now when I add the code below I always get a null error on the following line:
user.SetValue(System.Environment.UserName)
I noticed that on the design task/data source screen, non database form had new field "user", database connected form has "my:user". This must be throwing off the code but I don' t see where one would alter code for this extra "my:".
Please advise,
Jason