Simple InfoPath Query

P

Preston Park

I have an InfoPath form with two views. One has patient demographic
information, the other has a textbox for patient ID and a "Run Query" button.
I simply want the detail view to be populated based on the ID (without using
script). I have it working for reading the first record using the rule
editor, but I don't know how to filter for the single patient. I've read
elsewhere that a wildcard query won't work without writing a script, but a
simple WHERE x = 'Something' should. I can't find anything to tell me how to
do this though.

Is my information correct? Can I do what I want to do?

Thanks,

pjp
 
R

Ross Culver

Preston,

Have you tried putting a dropdownlist on your query view whose datasource is
the list of patients (text = name, id=patientid)?

The user selects the appropriate patient then clicks the 'search' button.
Your main view is your defaultview. That should work. It's basic InfoPath
functionality.

Of course, I'm assuming your using SP1.

Ross
 
P

Preston Park

Thank you for your response. A dropdown would be impractical as it would
contain too many choices. I was hoping that the user could enter the ID into
a textbox and click the "run query" button to retrieve the details -- without
any script.

pjp
 
N

NewIdiot

Hi preston,

I am not familiar with the extensive language used to really work infopath.
I have used it to make simple forms for my users to use which are linked to
an access database. the beauty of infopath is that the linking is easy and
the ease in which you can set up a simple query and result form. however the
drawback is that unless you know xml lang. it is harder to set up queries
that are complex. (ranges etc.)
however, if your user knows the patient or client id, then this process you
need is simple. Also, if your form is linked to a database like access, I am
confused as to why you would need to separate views to give your user access
to the info. You can set up the run query and the query results in the
same form.

The easiest way for me to explain this is to start with a new design form.

1) open infopath and click on design a form, then click on new from data
connection and let the wizard walk you thru linking to your database. It
will automatically used the fields you have set up in that database.

2)the result will establish a template with 3 tables and one button already
set up on the form. If you only need a query form and display, I would
delete the first section and button for adding new info.
3)right click on the query section your grouping of myfields will show and
list queryfields. click on the plus sign and you should see all the fields
of your database. you can drag and drop into the query section those fields
you think the user might need to access the file they need to display.

last, decide what you want your users to be able to do with the data. if
you simply wish the users to display the data, do number 4 only. if you
want some fields display only and others with the ability for the user to
update in the database you will need to do several things.

4)click on the data section and then the data fields under myfields and then
the plus sign to show the fields of data. drag and drop those fields that
you wish to show in the data section.

since you have added no other button, they will only be able to display and
not submit anything to the database. each time they change their query data
and hit run query it will automatically return with the necessary displayed
info.

if you choose for them to be able to update and submit data back to your
database you can set up some fields to display only or some fields to update
in that data table by adding display only expression boxes linked to
individual fields or draging and droping fields you wish them to update
clicking on those fields under data fields.
you would then create a seperate button under that data table section that
has button properties of "submit to database".

use expression boxs for those fields you want display only by clicking on
control and locating and clicking on "expression box" from the list. when
you do, a box will appear asking you to select the xpath and you can click on
fx and select a field of data. do this for as many fields as you need and
position them where you need them on the form. example I would put all the
display fields first and the fields I want them to have access to update
last.

I hope this helps...
 
Top