OpenArgs value not being passed to the form.

G

Guest

I am passing the query string as the OpenArgs agrument from the search form
to the Prospects_MainForm so that only those records, with the search
criteria met, are displayed.
The code written in the search form's cmdsearch button -
DoCmd.OpenForm "Prospects_MainForm", acNormal, , , , , strSql

where strSql is the string built based on the criteria selected.

The code in Prospects_MainForm's Load event is -
If Not IsNull(Me.OpenArgs) Then
Me.RecordSource = Me.OpenArgs
End If

Me.OpenArgs is showing as null.The value strSql is not getting passed from
the search form to prospects_mainform.Is the code right?
 
G

Guest

The OpenArgs id located in the right place, but I have few questions
1. When do you assign value to the strSql? Can you post the full code?
2. Are you using the openArgs in the Main form or in a sub form? it wont
work in a sub form
3. Why you are not using the WhereCondition of the OpenForm command line
instead of passing the all SQL?
 

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