Hi, hopefully someone can explain why, when the code below is run I get a form opened in datasheet view with the correct number of rows but no columns.
The form frmData is an empty form set to datasheet view, i have a combo box on another form with a list of the queries in the database and a button, that when pressed runs the code below.
Is there something else i need to be doing to get the columns to display?
Private Sub cmdOpen_Click()
Set q = CurrentDb.QueryDefs(cboRptSel.Value)
Set rs = q.OpenRecordset
Set f = New Form_frmData
f.Caption = cboRptSel.Value
Set f.Recordset = rs
f.Visible = True
End Sub
In anticipation of your help
The form frmData is an empty form set to datasheet view, i have a combo box on another form with a list of the queries in the database and a button, that when pressed runs the code below.
Is there something else i need to be doing to get the columns to display?
Private Sub cmdOpen_Click()
Set q = CurrentDb.QueryDefs(cboRptSel.Value)
Set rs = q.OpenRecordset
Set f = New Form_frmData
f.Caption = cboRptSel.Value
Set f.Recordset = rs
f.Visible = True
End Sub
In anticipation of your help