Repeating Section in Infopath 2007

S

sshines

I have 2 views on the form. The first view I am querying and pulling data
onto the second view. As soon as I execute my query my repeating section is
no longer inserted in the form even though I have edited the Default Values
to include in the form. What am I doing wrong?
 
S

sshines

I'm not understanding your response. Here is more information about my
explanation. Thank you so much for getting back to me. I really need some
help with this. I am having a problem with my main data connection - not my
secondary data connection. I have three tables in my main data connection
Table1, Table2 and Table 3. Table 3 is a repeating table.

Here are the steps that I am taking and my code:

On my first view I am querying a username field by clicking a button. Here
is the code behind my button:

Public Sub QueryEmployee_Clicked(ByVal sender As Object, ByVal e As
ClickedEventArgs)

Dim myNav As XPathNavigator = Me.MainDataSource.CreateNavigator()
Dim SelectedEmployee As String
Dim myADOConnection As AdoQueryConnection =
DirectCast(Me.DataConnections("MainConnect"), AdoQueryConnection)
Dim LoggedinUser As String

SelectedEmployee =
myNav.SelectSingleNode("/dfs:myFields/dfs:queryFields/q:Employee/@UserName",
Me.NamespaceManager).ToString

If SelectedEmployee = "" Then
MessageBox.Show("Please enter a Username for searching.")
Exit Sub

End If

Select Case Me.UserRole
Case "General"
LoggedinUser = System.Environment.UserName
If LoggedinUser <> SelectedEmployee Then
MessageBox.Show("You can only search for your own contact information.
Please enter YOUR username.")

myNav.SelectSingleNode("/dfs:myFields/dfs:queryFields/q:Employee/@UserName",
Me.NamespaceManager).SetValue("")

Exit Sub

End If

End Select

myADOConnection.Command = "select EmpID, PrefFirstName, PrefMidName,
PrefLastName, OfficeID, CellPhone, UserName from Employee where
Employee.UserName = " + "'" + SelectedEmployee.ToString + "'"

myADOConnection.Execute()

End Sub

After this query runs and I am now looking at the second view and my
repeating table is collapsed. There is no data in it and there shouldn't be
yet, but I want the table expanded so you users can easily see that this
information needs to be filled in. The Default Values are there - what am I
missing?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top