Delete from primary data source & Submit to secondary

T

tgingrich

What would be the best way to accomplish the following:

I have an access database containing employee access information. When an
employee terminates employment, I want to be able to have HR query the
employee record, then with a single button submit the employee information to
a secondary data source (a history file) and delete the record from the
primary data source.
 
S

S.Y.M. Wong-A-Ton

Deleting the employee record should be pretty straightforward: Retrieve the
XML for the main data source in code. Use the employee ID (retrieved e.g.
through the query the user performed and saved in a hidden field on the form)
in an XPath expression to retrieve the employee record from the main data
source. Then use removeChild() to delete the employee record from the XML for
the main data source. Finally, submit the form through code to save the
changes in the main data source back to the database.

Creating a history record in a secondary data source is a bit more
challenging, but it can be done. I am in the process of writing an article
that will demonstrate how to submit/update data to/in secondary data sources
such as XML files and databases in InfoPath 2003.
 
R

ridawg

Can you walk me through this? I would like to write my own code to perform a
delete against the database.

1. How do I retrieve the XML for the main data source in my code?
2. I do have the ID saved in a hidden field.
3. Not sure how to use the removeChild()
4. I have used the Submit in code.

I'm writing this in VBScript so an example in that would be great.

Thanks!
 

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