MkIIISupra
Programmer
Hey all, been a while since I have been here. Anyhow, I have a main form that can be fed from one of two data sources. Within that form are three subform, each of which also have two possible datasources.
I am trying to get the main form AND the sub forms to open and based on a value passed, select the appropriate data source. Now the main form is getting the appropriate command and opening the appropriate data source when called. But the sub forms are not. Below is my code and an error that I am getting. I have been looking and have not found the answer to my specific question... yet.
CODE BLOCK
Private Sub Form_Load()
DoCmd.Maximize
If (Me.OpenArgs) = "New" Then
' Use the Quert Select Customer to load the main form, then each SUB form is to be _
& assigned to it's appropriate Select query.
Me.Form.RecordSource = "qrySELECT_ShowCustomer"
Me.Requery
' These are the subForms I need to associate with the appropriate datasource.
Me.subShippersInformation!frmSELECT_ShowShipper.RecordSource = "qrySELECT_ShowShipper"
Me.subTransportationInformation!frmSELECT_ShowTransport.RecordSource = "qrySELECT_ShowTransport"
Me.subProductInformation!frmSELECT_ShowProduct.RecordSource = "qrySELECT_ShowProduct"
' MsgBox Me.OpenArgs
Exit Sub
ElseIf (Me.OpenArgs) = "Old" Then
' Use the Quert Recall Customer to load the main form, then each SUB form is to be _
& assigned to it's appropriate recall query.
Me.Form.RecordSource = "qryRECALL_Customer"
Me.Requery
' These are the subForms I need to associate with the appropriate datasource.
Me.subShippersInformation!frmSELECT_ShowShipper.RecordSource = "qryRECALL_Shipper"
Me.subTransportationInformation!frmSELECT_ShowTransport.RecordSource = "qryRECALL_Transport"
Me.subProductInformation!frmSELECT_ShowProduct.RecordSource = "qryRECALL_Product"
' MsgBox Me.OpenArgs
Exit Sub
End If
End Sub
ERROR MESSAGE
Run-time error '2465':
Microsoft Access can't find the field 'frmSELECT_ShowShipper' referred to in your expression.
SYSTEM SPECS
OS = Windows 2000 Pro running inside of Ubuntu Linux via VMWare.
Office Version = Access 2000 Professional
I hope this is enough to garner some assistance. I am continuing my search for the answer but as of late, no luck. I have also tried declaring my subforms as variables to no avail as well, unless I am declaring them wrong.
One by one the penguins steal my sanity!
I am trying to get the main form AND the sub forms to open and based on a value passed, select the appropriate data source. Now the main form is getting the appropriate command and opening the appropriate data source when called. But the sub forms are not. Below is my code and an error that I am getting. I have been looking and have not found the answer to my specific question... yet.
CODE BLOCK
Private Sub Form_Load()
DoCmd.Maximize
If (Me.OpenArgs) = "New" Then
' Use the Quert Select Customer to load the main form, then each SUB form is to be _
& assigned to it's appropriate Select query.
Me.Form.RecordSource = "qrySELECT_ShowCustomer"
Me.Requery
' These are the subForms I need to associate with the appropriate datasource.
Me.subShippersInformation!frmSELECT_ShowShipper.RecordSource = "qrySELECT_ShowShipper"
Me.subTransportationInformation!frmSELECT_ShowTransport.RecordSource = "qrySELECT_ShowTransport"
Me.subProductInformation!frmSELECT_ShowProduct.RecordSource = "qrySELECT_ShowProduct"
' MsgBox Me.OpenArgs
Exit Sub
ElseIf (Me.OpenArgs) = "Old" Then
' Use the Quert Recall Customer to load the main form, then each SUB form is to be _
& assigned to it's appropriate recall query.
Me.Form.RecordSource = "qryRECALL_Customer"
Me.Requery
' These are the subForms I need to associate with the appropriate datasource.
Me.subShippersInformation!frmSELECT_ShowShipper.RecordSource = "qryRECALL_Shipper"
Me.subTransportationInformation!frmSELECT_ShowTransport.RecordSource = "qryRECALL_Transport"
Me.subProductInformation!frmSELECT_ShowProduct.RecordSource = "qryRECALL_Product"
' MsgBox Me.OpenArgs
Exit Sub
End If
End Sub
ERROR MESSAGE
Run-time error '2465':
Microsoft Access can't find the field 'frmSELECT_ShowShipper' referred to in your expression.
SYSTEM SPECS
OS = Windows 2000 Pro running inside of Ubuntu Linux via VMWare.
Office Version = Access 2000 Professional
I hope this is enough to garner some assistance. I am continuing my search for the answer but as of late, no luck. I have also tried declaring my subforms as variables to no avail as well, unless I am declaring them wrong.
One by one the penguins steal my sanity!