problematic subform

ceferinos

New member
Local time
Today, 21:18
Joined
Dec 28, 2005
Messages
6
I am not an MS Access programmer. Our main resource person figured in an accident and will be gone for weeks.
My problem is with the subform and the ff. errors:
Error1:
The LinkMasterFields property setting has produced this error: 'The object doesn't contain the Automation object "Design Data."
Error2:
You can't add or change a record because a related record is required in table 'FanData'.

Our programmer placed a VB procedure in this subform:
Option Compare Database
Option Explicit

Private Sub desFanManufacturer_AfterUpdate()
desFanModel.RowSource = "SELECT FanData.fanPartNumber, FanData.fanManufacturer FROM FanData WHERE FanData.fanManufacturer = '" & desFanManufacturer & "'"

End Sub

Private Sub desFanManufacturer_BeforeUpdate(Cancel As Integer)
desFanModel.RowSource = "SELECT FanData.fanPartNumber, FanData.fanManufacturer FROM FanData WHERE FanData.fanManufacturer = '" & desFanManufacturer & "'"
End Sub

Private Sub desFanManufacturer_Change()
desFanModel.SetFocus
desFanModel.Text = "-Select Model No.-"
desFanModel.RowSource = "SELECT FanData.fanPartNumber, FanData.fanManufacturer FROM FanData WHERE FanData.fanManufacturer = '" & desFanManufacturer & "'"
End Sub

Private Sub desFanModel_GotFocus()
desFanModel.RowSource = "SELECT FanData.fanPartNumber, FanData.fanManufacturer FROM FanData WHERE FanData.fanManufacturer = '" & desFanManufacturer & "'"
End Sub


If anyone is willing to help, I can send the file.
 
If you want to post your db, I'm sure someone would take the time to look at it and offer suggestions. I will warn you up front that looking at code tells me your programmer was fighting a problem and stuck the same code in several events in an attempt to resolve the issue. There could be deeper problems that need to be resolved so the solution may not be simple.
 
How and where do I post the db?
 
First, make a copy. Then with the copy remove any sensitive data or change it to protect the innocent. You have to leave enough data to demonstrate the problem. Then, go to Tools>Database Utilities>Compact and Repair Database... Then zip up what is left and see if it is smaller than 393KB. If it is then press the reply button at the bottom of the last post. Put in your message then scroll down to the next screen. There is a button that says "Manage Attachments", press it. Press the browse and locate your zip file and hit upload. Then submit reply and you're done. If that does not work then post back and I'll give you an email addy to send it to.
 
Last edited:
I still get the same error messages. Although you did place a warning to select the Fan Manufacturer data first. I still do not know why the same errors appear.
 
Press <ALT> F11 and then Tools>References. Do you have any references with MISSING next to them? If so then make a note of the reference and UnCheck the reference. OK back to the code page and then Debug>Compile. Any errors? Does it work now? What exactly are you doing to create the error?
 
On the main switchboard, I try to add a new record for Project data. I get the Error1:
The LinkMasterFields property setting has produced this error: 'The object doesn't contain the Automation object "Design Data."

when I pick something from the dropdown box under Development Stage.

I get
Error2:
You can't add or change a record because a related record is required in table 'FanData'.
when I try to write a new record.
 
Here's another copy of the sample db. As I said originally, there could be (read as there are) several problems. I've cleared the two you mentioned but suspect there are probably more. This db needs to be normalized further. There are fields that are duplicated in more than one table. It still does not make a lot of sense to me but that is for you to know. Good luck with the rest of the project.
 

Attachments

Thanks. It works now. Please explain how you cleared the two problems so I could relay to our main resource person once he returns.
 
The ProjectData form was bound to a query that joined 4 tables. I changed that to a query that only included the ProjectData table, which was all that was needed. That cleared Error1 mentioned in your original post. Error2 was caused because you were trying to save a DesignData record without first setting the fanIDNo field. I changed the field that ComboBox desFanModel was bound to so that it set the fanIDNo field. There was no reason to have the Fan Model in the DesignData table. You can always get to that data through the FanData table.
 

Users who are viewing this thread

Back
Top Bottom