Burchy
Aug 7th, 2000, 09:41 AM
I'm tweaking an application already designed and there is a dbgrid showing the results from a SQL query which is:
Private Sub Form_Activate()
'Reset Mouse Pointer
Screen.MousePointer = vbArrow
' Link {Customer Name} and {Location} fields to frmComponentTracker
txtText1(0).Text = frmIMS.txtText(0).Text
txtText1(1).Text = frmIMS.txtText(5).Text
' Set Database Grid Title Bar Caption
DBGrid2.Caption = "System Configuration"
Set componentClass = New dataClass
'If (TypeName(systemClass) <> "Nothing") Then
With componentClass
Set .FormName = Me 'Pass in the current form.
Set .dataCtl = Data3 'The Data Control to manage.
Set .ProgressBar = ProgressBar2
.dbName = gDataBaseName
.Buttons = "cmdButton3"
.RecordSource = "SELECT * FROM component WHERE system_id = " & frmIMS.Data2.Recordset!system_id
.LabelToUpdate = lblRecordCount3
.Tag = "3" 'Identifies the controls.
.ProcessCMD 0 'Default to the 1st. record.
End With
'End If
End Sub
How can I transfer this data into a report? if it were a simple SQL query then it would be easy but because its linked to another form:
.RecordSource = "SELECT * FROM component WHERE system_id = " & frmIMS.Data2.Recordset!system_id
I cant get it to work in the report designer.
Or alternatively how can I print the dbgrid? PrintForm just gives me a black grid with the details black, barely readable but there.
Private Sub Form_Activate()
'Reset Mouse Pointer
Screen.MousePointer = vbArrow
' Link {Customer Name} and {Location} fields to frmComponentTracker
txtText1(0).Text = frmIMS.txtText(0).Text
txtText1(1).Text = frmIMS.txtText(5).Text
' Set Database Grid Title Bar Caption
DBGrid2.Caption = "System Configuration"
Set componentClass = New dataClass
'If (TypeName(systemClass) <> "Nothing") Then
With componentClass
Set .FormName = Me 'Pass in the current form.
Set .dataCtl = Data3 'The Data Control to manage.
Set .ProgressBar = ProgressBar2
.dbName = gDataBaseName
.Buttons = "cmdButton3"
.RecordSource = "SELECT * FROM component WHERE system_id = " & frmIMS.Data2.Recordset!system_id
.LabelToUpdate = lblRecordCount3
.Tag = "3" 'Identifies the controls.
.ProcessCMD 0 'Default to the 1st. record.
End With
'End If
End Sub
How can I transfer this data into a report? if it were a simple SQL query then it would be easy but because its linked to another form:
.RecordSource = "SELECT * FROM component WHERE system_id = " & frmIMS.Data2.Recordset!system_id
I cant get it to work in the report designer.
Or alternatively how can I print the dbgrid? PrintForm just gives me a black grid with the details black, barely readable but there.