Newbie needs to be able to run a simple SQL Query

P

patrick

Hello,

I have an InfoPath form that's linked to an Access database. The form
is a review of a customer service call. A call can have multiple
reviews. A call has an ID and a review (my form) has an ID. The
review ID is supposed to be related to the call ID.

For example, if the call has ID 123, and the review is the first review
on that call, the review ID should be 123a. The second review should
be 123b and so on.

What I would like to happen is this. The user opens a new form. When
they populate the "Call ID" field, I run an SQL query in the script.
That SQL query looks for any existing reviews with the same starting
string and returns them as a collection. In the example above, if they
enter "123", it should return the strings "123a" and "123b". I can
then sort that collection, find the last one entered ("123b"), and
append the next letter ('c') to the ID to create my new review ID
("123c").

In trying to figure this out, the only SQL stuff I've come across has
been to run queries using the form fields directly, which seems to be
populating them directly from the query. I don't want to do this. I
want to run a very simple query in my script method that doesn't
interact directly with the form at all, but returns me a collection of
strings. I want to sort those strings in my method and then populate
the appropriate field in the form.

Any help with this would be much appreciated.
 

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