Query not returning data the first time, returning data second time

A

abc

Hi again!

I'm connected to an access db. My view consists of a query section and
a data section. When the user selects criteria (from dropdown lists,
date picker, and/or checkboxes) and clicks search (button-run query) it
should populate the criteria into the date section. The user can then
select the "clear fields" button to clear the query fields to select
new criteria to run.

My problem: Everything works except the date picker. When I select a
date as the only criteria and run the query, it returns nothing "The
specified query did not return any data..."(not even an error). When I
clear the fields (button) and select the same date (again) and re-run
the query, it then populates into the data fields.

Why do I have to run the query for date picker twice in order to return
data..??

My dropdown lists and checkboxes return data the first time. Also,
when I select a date along w/ another criteria it will return data, but
when selecting a date by itself it does not return any data.

Please help!
 
S

Scott L. Heim [MSFT]

Hi,

By chance, are you able to repro this with the Orders table in Northwind? I
am not seeing the behavior you are describing so let me describe how I
created my sample:

- Created a new InfoPath solution from a data connection
- Chose the Access Northwind database
- Selected the Orders table
- Dragged the Order Date field from the queryFields list to my query section
- Dragged the Orders table from the dataFields list to my data section
- Previewed the form
- Clicked on the Date Picker control that was created by default, clicked
in the "year" so I could scroll back to 1997, scrolled back to April,
selected the 8th and clicked the Run Query button.

When I completed the above steps, I get data returned all the time. Do
these steps sound correct? If you are unable to repro the issue using the
Orders table, is there any difference in your data? For instance, are you
definitely using a DateTime field in Access? When you select a date using
the Date Picker control in InfoPath do you see just the date or are you
getting both a date and time?

Thanks!

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
 
A

abc

I reproduced your steps using the northwind db and it works, but when I
follow the same steps into my form, it still does not produce data the
first time around.

I checked my access db and the field is set to Date/Time (Format: Short
Date (ex. 6/19/1994)).

When infopath does produces data the second time around, I see the date
only (no time).
 
S

Scott L. Heim [MSFT]

Hi,

Sorry for the delay in getting back with you.

Would it be possible to create a new solution based just on the "problem"
table and see if it reproduces the behavior? If so, please send me a
description of your table structure so I can try to reproduce it here.

Thanks,

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
 
A

abc

I created a new xsn form.. and followed your steps and it queries
correctly...

I go back into my original form.. delete the query view.. create a new
view.. follow the steps.. and it still does not query the first time
around =P
 
A

abc

I just realized something comparing my new form to the original form..
when I preview the new form (that queries correctly), the cursor is NOT
sitting in the field... but when I preview the original form, the
cursor IS sitting in the field.

does this make any sense???
 
S

Scott L. Heim [MSFT]

Hi,

Is there anything at all different between the test form and your original
form? Not that this should really have any effect, but let's also delete
your InfoPath cache just to insure we are starting fresh since you
recreated the View.

- From the Start->Run box, enter: InfoPath /cache clearall
- Test again

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
 
A

abc

when i follow this step:
From the Start->Run box, enter: InfoPath /cache clearall

it opens up the folder where i saved the sp1.

i tested again.. same outcome.. did i not clear the cache correctly?
 
S

Scott L. Heim [MSFT]

Hmmm....not sure if that applies or not. Do you have any Rules on Startup
that sets focus to that box? What happens if you move off the field to
another and then select a date?

I know these are odd requests but I am unsure of why you are seeing this
behavior...sorry.

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
 
S

Scott L. Heim [MSFT]

What should happen is simply InfoPath should be launched - nothing else.

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
 

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