G
Guest
I have a 'Mfrs_Table' subform inside a 'Suppliers_Table' form along with a
textbox containing SQL to build a Mfrs_Table recordset. When I select 'Use
SQL' from a combobox I would like to change the recordset of the 'Mfrs_Table'
subform accordingly.
The Test() function is invoked by the combobox when it changes and
illustrates the basic concept:
Public Function Test()
Dim sSQL_Mfrs As String
Dim oRS_Mfrs As Recordset
sSQL_Mfrs = "SELECT * FROM Mfrs WHERE SupplierID=" & CStr(Me!SupplierID)
Set oRS_Mfrs = goCurrentDB.OpenRecordset(sSQL_Mfrs)
Set Me.Mfrs_Table.Form.Recordset = oRS_Mfrs 'Error here
End Function
The following error is generated when the 'set ...Recordset = ..." is
executed:
The macro or function set to the BeforeUpdate or ValidationRule property for
this field is preventing Microsoft Office Access from saving the data in the
field.
How can I fix this problem?
textbox containing SQL to build a Mfrs_Table recordset. When I select 'Use
SQL' from a combobox I would like to change the recordset of the 'Mfrs_Table'
subform accordingly.
The Test() function is invoked by the combobox when it changes and
illustrates the basic concept:
Public Function Test()
Dim sSQL_Mfrs As String
Dim oRS_Mfrs As Recordset
sSQL_Mfrs = "SELECT * FROM Mfrs WHERE SupplierID=" & CStr(Me!SupplierID)
Set oRS_Mfrs = goCurrentDB.OpenRecordset(sSQL_Mfrs)
Set Me.Mfrs_Table.Form.Recordset = oRS_Mfrs 'Error here
End Function
The following error is generated when the 'set ...Recordset = ..." is
executed:
The macro or function set to the BeforeUpdate or ValidationRule property for
this field is preventing Microsoft Office Access from saving the data in the
field.
How can I fix this problem?