Set focus to the first field in a repeating table - InfoPath Dev
in

InfoPath Dev

Set focus to the first field in a repeating table

Last post 02-24-2009 09:57 AM by martinpalmer. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 02-24-2009 09:00 AM

    Set focus to the first field in a repeating table

    All,

     

    I have a repeating table (group2_44).  The first field must be exactly 7 characters long.  How do I data validate this length?  If it is not 7 characters in length, I need to have a pop-up and return the focus to the first cell in the row.

    Here is what U have so far but its not working.  It pops up the warning but does not return the user to the first column of the row.  if I take up the View statement, the pop-up shows but the Text is on the next field.

    Sub msoxd_my_Prefix_OnAfterChange(eventObj)

       If eventObj.IsUndoRedo Then
        Exit Sub
       End If

        empid = eventObj.Site.text
           
        if (len(empid) < 7) then
             XDocument.UI.Alert("Please enter the Employee ID Including the Prefix.")
             XDocument.View.selectsingleNode(eventObj.Site, Type.Missing)
            
             exit sub
        end if

    ...

     

    Thanks.

  • 02-24-2009 09:57 AM In reply to

    Re: Set focus to the first field in a repeating table

    Ok... So an update to this.  It also fires when I add a new row to the table and I would rather it didn't do that.  Any ideas would be helpful.  Would it be better to do this validation in the validation event?

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