M
Mike_L_W
Hello,
I am test converting Access 2003 databases to Access 2007.
On this particular DB I have widely used code to late bind the sub forms
record source similar to the example below. Access 2007 evaluates the code
without any error but also fails to display the qry results in any sub forms
without Link Master and Child fields set. Any ideas on how to modify this
method to work with 2007 or must I find an alternative?
Thanks for any help
Best Regards
Mike
Private Sub MainTab_Change()
On Error GoTo Err_MainTab_Change
'The following code leaves the subform RecordSource unbound,
'until the user clicks on the tab. This on-demand technique will allow the
main form to load 'without trying to populate all of the subforms.
Select Case MainTab.Pages.Item(MainTab.Value).Name
THIS WILL DISPLAY BECAUSE THERE ARE MASTER & CHILD LINKS
Case "DueActions"
If Len(FsubVLActionsRequired.Form.RecordSource) = 0 Then
FsubVLActionsRequired.Form.RecordSource = "QryVLDueActions"
End If
Case "BookWork"
If Len(FsubBookingData.Form.RecordSource) = 0 Then
FsubBookingData.Form.RecordSource = "QryBookingData"
FsubVLNextServiceNotes.Form.RecordSource = "QryNextServiceNotes"
End If
Case "Maintenance"
If Len(fsubVLVehiclesMaint.Form.RecordSource) = 0 Then
fsubVLVehiclesMaint.Form.RecordSource = "QryMaintenanceData"
End If
THIS WILL NOT WORK AS THERE ARE NO MASTER & CHILD FIELDS SET
AS THE DATA REQ IS NOT RELATED TO THE CURRENT RECORD
Case "OrdersOutstanding"
If Len(FsubOutstandingORDERS.Form.RecordSource) = 0 Then
FsubOutstandingORDERS.Form.RecordSource = "QryOutstandingOrders"
End If
End Select
Exit_MainTab_Change:
Exit Sub
Err_MainTab_Change:
MsgBox Err.Description
Resume Exit_MainTab_Change
End Sub
I am test converting Access 2003 databases to Access 2007.
On this particular DB I have widely used code to late bind the sub forms
record source similar to the example below. Access 2007 evaluates the code
without any error but also fails to display the qry results in any sub forms
without Link Master and Child fields set. Any ideas on how to modify this
method to work with 2007 or must I find an alternative?
Thanks for any help
Best Regards
Mike
Private Sub MainTab_Change()
On Error GoTo Err_MainTab_Change
'The following code leaves the subform RecordSource unbound,
'until the user clicks on the tab. This on-demand technique will allow the
main form to load 'without trying to populate all of the subforms.
Select Case MainTab.Pages.Item(MainTab.Value).Name
THIS WILL DISPLAY BECAUSE THERE ARE MASTER & CHILD LINKS
Case "DueActions"
If Len(FsubVLActionsRequired.Form.RecordSource) = 0 Then
FsubVLActionsRequired.Form.RecordSource = "QryVLDueActions"
End If
Case "BookWork"
If Len(FsubBookingData.Form.RecordSource) = 0 Then
FsubBookingData.Form.RecordSource = "QryBookingData"
FsubVLNextServiceNotes.Form.RecordSource = "QryNextServiceNotes"
End If
Case "Maintenance"
If Len(fsubVLVehiclesMaint.Form.RecordSource) = 0 Then
fsubVLVehiclesMaint.Form.RecordSource = "QryMaintenanceData"
End If
THIS WILL NOT WORK AS THERE ARE NO MASTER & CHILD FIELDS SET
AS THE DATA REQ IS NOT RELATED TO THE CURRENT RECORD
Case "OrdersOutstanding"
If Len(FsubOutstandingORDERS.Form.RecordSource) = 0 Then
FsubOutstandingORDERS.Form.RecordSource = "QryOutstandingOrders"
End If
End Select
Exit_MainTab_Change:
Exit Sub
Err_MainTab_Change:
MsgBox Err.Description
Resume Exit_MainTab_Change
End Sub