1. when are you setting other values in form 2?
every time when opening the form 2, it will run this sql to get all fields value.
Dim sqlString As String = "SELECT * FROM tbl_TemporaryLicence WHERE TempPermitID = " & RegNo
2. Are you getting the correct "RegNo" from your main data source
that the problem. For example, i click row 3 in form 1, only the ID field will filled with 3, I think that means it passes 3 to form 2. But in that SQL , the value of RegNo is always the value of the first row in form 1.
if ID field in form 2 can get 3, why when I use
Dim _RegNo As XPathNavigator = Me.DataSources("tbl_TemporaryLicence").CreateNavigator().SelectSingleNode("/dfs:myFields/dfs:dataFields/d:tbl_TemporaryLicence/@TempPermitID", NamespaceManager)
RegNo = _RegNo.Value
the value of RegNo is not 3.
and thanks for your reply