I am creating a few forms that access an Access database that will be used to enter data into the database. I am able to open records from the database and scroll through records one at a time and have added features to be able to search for and display a single record. The problem that I am having is when I load a single record and then edit that record, I am unable to save any changes made to the record, in other words, the record doesn't update on the database.
I can add new records and edit records as long as I scroll to them using .next(), .last(), .first(), and .previous() commands; however, when I load a single record I can't figure out how to save changes to that record in the database.
Solved! Go to Solution.
Views
Replies
Total Likes
Here it is:
xfa.sourceSet.DataConnection.open();
xfa.sourceSet.DataConnection.first();
var oDataConnList = xfa.sourceSet.DataConnection.nodes
var nCount = oDataConnList.length;
for (var i = 0; i < nCount; i++){
if (CurrentRecord.rawValue != SearchField.rawValue){
xfa.sourceSet.DataConnection.next();
}
}
This opens the data connection, makes sure it starts on the first record, counts the number of records and scrolls through each record until it finds the one the user searched for!
Views
Replies
Total Likes
Ok...so I think i can get it to work by doing something like:
xfa.sourceSet.DataConnection.open(); | |
xfa.sourceSet.DataConnection.first(); | |
var oRecordList = ??????????? | |
var nCount = oRecordList.length; | |
for (var i = 0; i < nCount; i++){ | |
if (CurrentRecord.rawValue != SearchField.rawValue){ | |
xfa.sourceSet.DataConnection.next(); | |
} | |
} |
where CurrentRecord is a text field that shows the index of the current record and SearchField is the field where a user enters the record that they are searching for.
I think I just need to figure out how to count the number of records in the database. Any ideas?
Here it is:
xfa.sourceSet.DataConnection.open();
xfa.sourceSet.DataConnection.first();
var oDataConnList = xfa.sourceSet.DataConnection.nodes
var nCount = oDataConnList.length;
for (var i = 0; i < nCount; i++){
if (CurrentRecord.rawValue != SearchField.rawValue){
xfa.sourceSet.DataConnection.next();
}
}
This opens the data connection, makes sure it starts on the first record, counts the number of records and scrolls through each record until it finds the one the user searched for!
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies