'openform Macro Where criteria

I am using a button from an unbound nav form to open a different form. The button Macro closes the nav form and opens the form I want with no issues.

I have a query that gets a value.

I want to open my form on the value of the query field match to the form's recordsource. The query is not associated with the recordset of the form directly, it's just a way to reference the value. It simply has one field that gets the value I need.

Please suggest some syntax in the where condition of the macro that sets the record of the form I am opening to the value in the query...

I have tried Where Condition= =[qrySeparateIDNUM][IDNUMVALUE] =Forms!MyForm!FORMIDNUM

not working macro error

EDIT: I have decided to use VBA to do this. OnClick of the unbound nav. I open the target form AcNormal, but I cant get me.InvoiceID from the form recordset query to open to the matching value. BTW this DOES work when you open a record on the SAME form from a record within the form, but not from an unassociated form like my unbound nav, why?

EDIT Number 2

For everyone's edification, this worked, modify for your use.

Private Sub CommandOpenTarget_Click()

DoCmd.OpenForm "frmMain"

Forms("frmMain").Recordset.FindFirst "INVID = " & Me!ID

End Sub

As to continue my journey into programming I have decided to fully explain this answer in the context of what I was trying to accomplish. Too many times, in this and other forums and resources, many people can not find the answers they are looking for. I have been working on my concurrent projects for more than a year on both of them, because, like I described to June7, I'm not very good yet, even now, but if someone took the time to fully explain what COULD be done and why it works, it helps people stop their endless searching. Include results from a suggestion, and be detailed in your question, and hopefully the people who weigh in will fully explain their solution and describe the results from their suggestion.

The negs, screw you... It was as simple as the above...I don't see anyone else trying to help, but the neg, f*off.

The fact that no one knows this and that no one could answer this befuddles me



Solution 1:[1]

For everyone's edification, this worked, modify for your use.

Private Sub CommandOpenTarget_Click()

  DoCmd.OpenForm "frmMain"

  Forms("frmMain").Recordset.FindFirst "INVID = " & Me!ID

End Sub

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1