I have the following code:
1. The first code segment works. It is contained within a function which passes a value (Long Integer) to TempVars!TempContactID. The form opens with the correct record.
Code:DoCmd.Browseto acForm, "frmContactsMain", "frmSCD.NavigationSubForm", "[ContactID]=" & TempVars!TempContactID, ""
2. The second code does not worked and I've tried several different iterations of it. It's value comes from the same function and BUT it is a STRING variable - TempVars!FNumber. The form opens but there is all fields are empty.
There are no load or open even events for the new form and there are no datatype mismatches.
My idea would be that the where condition in my second code is not "wrapped" correctly.Code:It always happens, as soon as I post the thread, I discover the issue. The problem was that in the form that was being opened in the query the FNumber field had a Criteria which was competing with the where condition. It works fine when I delete it. DoCmd.Browseto acForm, "frmFacilityOwnersMain", "frmSCD.NavigationSubForm", "[FNumber]= '"& TempVars!TempFNumber & "'", ""
Any other ideas?


WhereConditions in DoCmd.BrowseTo functions
Reply With Quote


