I have been tasked with converting an Access application to .NET. I know nothing about Access. My issue is that I need to be able to see the actual query being invoked via VBA from a form.
The VBA code uses a command called DoCmd.OpenForm to open a form and display records. The VBA code is inside an event handler for a button. When clicked, the button opens a form using the DoCmd.OpenForm and its associated parameters. The fourth parameter in the DoCmd.OpenForm is WhereCondition according to MSDN, and the developer used this to insert a WHERE clause (without the word WHERE per MSDN). The WHERE clause used is ProjectNumber = Me![ProjectNumber].
The problem is that I cannot see the rest of the query, i.e., what is the entire SELECT statement and how does Access know what fields to select to populate the form opened by the DoCmd.OpenForm command? Is there anyway to find that out? To add to the confusion, the target form opened by DoCmd.OpenForm has it's own query associated with it. In other words if the form is opened in design mode, under Data-->Record Source, it has a query listed. I can see the syntax for that query, just not the "partial" one that is called from the VBA code using the DoCmd.OpenForm command. It seems like there are two different queries used to populate the target form.
I have tried ODBC tracing and it did not show anything. Since the application talks to a SQL Server backend, I may be able to have our DBA turn on tracing, but this is not a great option since the application is huge and has this scenario present in many forms and I'm not sure it will even catch anything. Any help is greatly appreciated.



