Hi all,
I am using a nested query, kindly taught to me by forum contributors a few days ago.
I am encountering a strange issue with a "Load" routine, which loads queried data into the form from SQL string.
Here is the nested query:
Code:
Set rs = db.OpenRecordset("SELECT * FROM MfgOperations WHERE (((MfgOperations.Index) In (SELECT TOP 1 Dupe.Index FROM MfgOperations AS Dupe WHERE Dupe.ID=MfgOperations.ID ORDER BY Dupe.Version DESC))) AND MfgOperations.Active = True AND MfgOperations.ID = '" & opID & "' ORDER BY MfgOperations.ID;")
And the code fails directly after when i begin assigning any one field in this query to a textbox item....
Code:
textbox1.value = rs.fields("ID")
The failure is The value you entered is not valid for this field.
Now, i made a specific code note of this issue back when I was using a double query instead of a nested query.
The double query was named "Versions" for example. So when I assigned the textbox value, it failed until I did this...
Code:
textbox1.value = rs.fields("Versions.ID")
However, because I am using this new nested query, i'm having trouble figuring out how to resolve this... I've tried...
Code:
textbox1.value = rs.fields("Dupe.ID")
and
Code:
textbox1.value = rs.fields("MfgOperations.ID")
No avail... This is present with any textbox object or any field I attempt to assign to within this query.
Thanks for any help!