I get the Record but from the other TABLE…

With the code below, I get the “correct” Record, but from the other TABLE…

“SELECT * FROM Children WHERE ParentID=576;)”

I was so “stoned”… I changed the TABLE name (Children above) to Foo, compile run and get my Record…

NB: There is a Record ID 576 in another TABLE, related to the Children one (of Course, the Parent)…

Context:
The code is in the Open Event of the View by Record window. The db (SQLiteDatabase Reference) is used to populate the window and re-used to get a RowSet for the associated Children Record.

At first, I used the Variable used to get the Parent Record. To be sure there is nothing between the other TABLE and this one, I used its value.

Checked with Xojo version 2023r1.1 I think: same wrong result.

Some times I am asking what is this mojo business…

I think you need 2 row sets, one for each table. My guess is they’re getting mixed up. Or 1 rowset but close it before running the next SELECT. Or use a single query with a JOIN to return all the data? Maybe you can you post the code you’re using to populate the window?

Hi Eric,

what I really need is either a good night or an eyes surgery…

The code worked fine, looks fine with all comments. The core code was here since… then I added code to read a brand new TABLE (Childs…). As often, Copy/Paste is nice unless you forget to change a ingle word !

All ok after an afternoon nap :rage:

And I was unable to remove or correct the post…

We all suffer from this. Glad you got it working.

1 Like