I am getting a msg box for Trade_No. I dont know why.
Hi Jim,
[Trade_No] is actually in the record source. I am sure of this. I just double checked it. Its wanting a parameter value. The msg box displays the [Trade_No] and the forms filter property does display the [Trade_No] in the property sheet. Let me know what else you might think it is. Thank you
Hi Ryan, i do not have any msgbox codes in the form. Only the load event.
[Trade_No] is actually in the record source.
What if you remove it?
1. Open the called forms record source on its own. Do you get a prompt for trade_no?
2. If not, comment out the code in the forms on load event and test again. Make sure the forms filter and order by properties are blank.
3. If you still do not get a prompt, then you must have the field misspelled in the onload code.
Jim
Watch out for The letter O versus a zero
Jim
Ok so I commented out the forms On Load event and I do not get the msg box prompt. I guarantee it is not misspelled. I deleted [Trade_No] and added it back on the form just in case there was something wrong with the field.
Does is matter if both forms record source are based on the same table?
I do not know what is happening. I have uploaded a pared down db and would be grateful for your checking what I did. Its driving me nuts. thank you for the help.
What Mark posted above should solved the issue, or you can try open your form in this way:
DoCmd.OpenForm "frmProjects_Extended", , , "[Trade_No] = '" & Replace(Me.Trade_No, "'", "''") & "'", , acDialog
By doing above, you no need to look into the OpenArgs property.
Does it happen when OpenArgs hold a null string ? (Null value and Null string are not the same thing).
If so, you might want to refine your If statement:
If (Nz(Me.OpenArgs, "") & "") <> "" Then
Or with build in constants (this is more explicit):
If (Nz(Me.OpenArgs, vbNullString) & vbNullString) <> vbNullString Then
Me.Filter = "[Trade_No] = '" & Me.OpenArgs & "'"
gives you: Hi experts, sorry I though I had responded earlier. It works great now. Thanks so much. Lesson learned about strings.
[Trade_no] is not in the forms recordsource, so you can’t filter on it.
You’ll need to add that field trip forms records or not filter on it by disabling the code in the Onload event.
Jim