Does anyone have any idea why these two queries would return the same recordset bar the addition of 'txtStatus' to the second query (that part is obvious, they're meant to), but when the record data is changed via another form (launched from a button on the 'results' form) the form populated by first query automatically updates, whereas the same form when populated by second query requires a forced ‘Requery’ (triggered from the record detail form) before it will update?
This is the query as I first wrote it some time ago:
This is what I changed it to when a user requested that the 'Status' be added to the search results:
It’s got me stumped! I noticed recently that one of my search results forms was updating when I was editing the record on another form. I couldn’t recall implementing that functionality (but it is on the ‘to do’ list) so I started looking into why & how it was doing it. Turns out there is no requery in the code (which is exactly as I thought), it’s just doing it by itself. I can switch it on and off by swapping out the query strings - the top one automatically updates, the bottom one doesn’t, and I can’t figure out why. Also, the timing of the update varies from one machine to another. On my machine it doesn’t update until I click a button on the query results form, but on another machine it updates as soon as the change is made to the record in the record detail form.
To be honest, I was quite surprised to see that it was updating the search results form without the requery.
Can anyone shed any light on the subject?
Cheers,...Jon.
This is the query as I first wrote it some time ago:
Code:
strSQL = "Select B.* From tblDWGIndexMain As A " & _
"Inner Join tblDWGIndexMain As B On A.DWG = B.DWG " & _
"Where A.ProjectNumber = " & Chr(34) & Me.txtProjectNumber.Value & Chr(34) & _
" AND B.ProjectNumber Is Null Order By B.DWG" _
This is what I changed it to when a user requested that the 'Status' be added to the search results:
Code:
'strSQL = "Select B.*, " & _
"(SELECT Status FROM tblStatus WHERE tblStatus.anumStatus=B.anumStatus) AS txtStatus " & _
"From tblDWGIndexMain As A " & _
"Inner Join tblDWGIndexMain As B On A.DWG = B.DWG " & _
"Where A.ProjectNumber = " & Chr(34) & Me.txtProjectNumber.Value & Chr(34) & _
" AND B.ProjectNumber Is Null Order By B.DWG"
It’s got me stumped! I noticed recently that one of my search results forms was updating when I was editing the record on another form. I couldn’t recall implementing that functionality (but it is on the ‘to do’ list) so I started looking into why & how it was doing it. Turns out there is no requery in the code (which is exactly as I thought), it’s just doing it by itself. I can switch it on and off by swapping out the query strings - the top one automatically updates, the bottom one doesn’t, and I can’t figure out why. Also, the timing of the update varies from one machine to another. On my machine it doesn’t update until I click a button on the query results form, but on another machine it updates as soon as the change is made to the record in the record detail form.
To be honest, I was quite surprised to see that it was updating the search results form without the requery.
Can anyone shed any light on the subject?
Cheers,...Jon.