Repeating tables and Views - InfoPath Dev
in

InfoPath Dev

Repeating tables and Views

Last post 06-23-2009 06:47 AM by sshines. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 06-23-2009 06:38 AM

    Repeating tables and Views

     

    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 tables.

    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?

     

    Filed under:
  • 06-23-2009 06:47 AM In reply to

    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 tables.

    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?

    Filed under:
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.