Hi,
No problem! What I was attempting to do was describe my sample - in the
end, this is not important. So let me clarify: my understanding is that you
simply need your form to pre-populate when opened just as if the user had
clicked the "Run Query" button - correct? If this is correct, then after
you populate the Account_Number field, the only other thing you should need
in the code is:
XDocument.QueryAdapter.Query
I hope this clarifies things a bit! (Sorry for the confusion...)
Best Regards,
Scott L. Heim
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights
mdsmitty - 18 May 2005 22:20 GMT
Sorry to bug you again Scott...I have another idea to get my desired result.
The code you sent seemed to work but i thought of another issue that may come
up using the On Load Event. If the Account number is not loaded before the
On Load Event runs then it won't know what to query.
What is the best way to use the Account_Number field and have the query run
based on the information within that field without using a Query Button?
Thanks again for your help and patiance.
> Hi,
>
[quoted text clipped - 15 lines]
>
> This posting is provided "AS IS" with no warranties, and confers no rights
Scott L. Heim [MSFT] - 19 May 2005 13:52 GMT
Hi,
No problem. Although I am a bit confused by the question: if you are using
code to populate the Account_Number field, why would it not be populated
before you execute the query in the Load event?
Are you populating the Account_Number field in the Load event?
Scott L. Heim
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights
mdsmitty - 19 May 2005 14:31 GMT
That was the issue I was not sure of...our programmer was doing all this
behind the scenes and frankly, that is all over my head. After speaking to
him he told me that he was populating the account number before the form was
loaded therefore the On Load Event would be able to pick up the account
number and query the database for the demographics. I don't have an answer
as to why the code didn't work yesterday but I have a feeling I was doing
something wrong or missing a step. The main issue I think was the fact that
I was testing several methods and had too many variables while testing that
affected one and other. Once I created a "fresh/new" test form the On Load
Event worked.
To be honest, I don't know how the programmer is populating the account
number but he did say it was before the form was loaded.
Thanks again for your help...if you have any other questions, let me know.
> Hi,
>
[quoted text clipped - 8 lines]
>
> This posting is provided "AS IS" with no warranties, and confers no rights
mdsmitty - 19 May 2005 13:59 GMT
Scott
i got it to work...I think with all the screwing around adding and deleting
code on the form I was testing yesterday caused most of the errors. I
created a new test form this morning and was able to get the form to work
both with the On Load Event as well as using a Rule to query and populate the
demographics after the form was opened.
Thanks again for all your help and patience.
Mike
> Hi,
>
[quoted text clipped - 15 lines]
>
> This posting is provided "AS IS" with no warranties, and confers no rights