First I apologize for what must be a fundamental question that has been answered many a time. I have read over a dozen posts in this forum about this and am using the suggested methods.
This code is executed from a command button - straightforward "preview data" thinking and a simple query, set to the RecordSource of an unbound subform. Upon clicking the button, the subform changes from a blank space to what would appear to be a results query, as I can see the record selectors. However, there is no data being displayed (yes, there is data in the referenced table).
The odd thing is that I am using almost exactly the same code in a different database except the execution is from a toggle box/radio button selection. Zero errors or issues. I've compared the property sheets of the two forms and subforms and examined both sets of code. I cannot figure out where the obvious error is.
Second, I apologize if you don't see a reply or thanks - my attempts to do so on a previous thread were getting blocked as Spam-like or possible inappropriate content. So please know I appreciate your assistance and at some point, I'll figure out how to reply to posts to say thanks.
Code:
Dim strSQL As String
strSQL = "SELECT tblPOS_Import_Prelim.* From tblPOS_Import_Prelim ORDER BY tblPOS_Import_Prelim.Dist_Name, tblPOS_Import_Prelim.Shipment_Date, tblPOS_Import_Prelim.Bill_To_Name;"
Me.frmPOSPreview.Form.RecordSource = strSQL
Me.frmPOSPreview.Form.Requery
This code is executed from a command button - straightforward "preview data" thinking and a simple query, set to the RecordSource of an unbound subform. Upon clicking the button, the subform changes from a blank space to what would appear to be a results query, as I can see the record selectors. However, there is no data being displayed (yes, there is data in the referenced table).
The odd thing is that I am using almost exactly the same code in a different database except the execution is from a toggle box/radio button selection. Zero errors or issues. I've compared the property sheets of the two forms and subforms and examined both sets of code. I cannot figure out where the obvious error is.
Second, I apologize if you don't see a reply or thanks - my attempts to do so on a previous thread were getting blocked as Spam-like or possible inappropriate content. So please know I appreciate your assistance and at some point, I'll figure out how to reply to posts to say thanks.