Hello all,
I have a form being opened modal by a calling form
Once the frmSubWork form is closed I would like to know what event is fired by VB? The reason is I have an ADODC that feeds a read only datagrid showing all of the work a subcontractor has carried out.Code:Private Sub cmdWorkForm_Click() If txtSCID.Text = "" Then frmSubContractor.Refresh End If lngWrkid = CLng(txtSCID.Text) frmSubWork.Show vbModal, frmSubContractor End Sub
The issue I am having is the datagrid, once the form is returned focus is not showing all of the records.
followed byCode:Private Sub UpdateDatagrid() Dim strSQL As String Dim lngSCID As Long Dim dgRS As ADODB.Recordset Set dgRS = New ADODB.Recordset strSQL = "SELECT * FROM tblSCPay WHERE SubContractor = " & txtSCID.Text With dgRS .ActiveConnection = cn .CursorType = adOpenForwardOnly .CursorLocation = adUseClient .LockType = adLockReadOnly .Source = strSQL .Open , , , , adCmdText End With Set dgdSCWork.DataSource = dgRS With dgdSCWork .Refresh End With dgRS.Close Set dgRS = Nothing End Sub
that achieves nothing, hence I need to know what event is firing.Code:Private Sub Form_GotFocus() Call UpdateDatagrid End Sub
Any assistance is very much appreciated.
Kind regards
Steve


Reply With Quote
