Master/Child Link Issue

CarrieFisher

Registered User.
Local time
Today, 17:50
Joined
Feb 25, 2011
Messages
27
Good Morning,

Could you please help me determine how to link the subform

Inside the subform I have tblemploymenthistory which has the following fields

-employeeid (primarykey)
- employee Number
- Start Date
- End Date
- Position
- Salary
- Employee Status


I wanted to link it to tblemployees (master)
- employeeid (primarykey)
- employee Number
- employee last name
- employee first name
- employee middle name
- etc..

I linked both employeenumbers for the child and master

I receive the following error -

"The LinksMastersFields Property setting has produced this error": Invalid outside procedure."

Any help would be greatly appreciated!

Carrie
 
Thank you for your quick response!!

I did as you suggested and I am still getting the same error :mad:

However, I think it might be something more then I think.

I have added some print screens as there many be some key points I am missing to describe.

Also, when I linked employeeid to employeeid it made it into 2 records versus 1 will a list of employment histories.


Any advice would be greatly appreciated!
 

Attachments

  • employment history second record.jpg
    employment history second record.jpg
    102.6 KB · Views: 205
  • employment history error message.jpg
    employment history error message.jpg
    103.9 KB · Views: 181
  • employment history subform properties.jpg
    employment history subform properties.jpg
    102.9 KB · Views: 193
You need to use the names of the control source not the name of the control.
 
invalid outside procedure sounds like a coding/compile error in your forms code. try compiling and see what happens. compile errors can produce strange behaviour.
 
You need to use the names of the control source not the name of the control.

I am so sorry, I forgot to explain that I am a beginner. Could you please explain this more to me?

Thank you in advance,

Carrie
 
Change the child link field from IntEmployeeNumber to Employee number
 
You may have one too many End Sub or End Function

Look through your code (like gemma-the-husky advised) and for each Private Sub ... there must be a matching End Sub. Pairs. If you find an End Sub floating around, delete it and Debug > Compile.

I'm talking with reference to the error.
 
You may have one too many End Sub or End Function

Look through your code (like gemma-the-husky advised) and for each Private Sub ... there must be a matching End Sub. Pairs. If you find an End Sub floating around, delete it and Debug > Compile.

I'm talking with reference to the error.

Hi,

Thank you for your help, I have tried what you stated (I think :( )

I get an error when I debug - I am very lost. Sorry. Here are some print screens if you would not mind have a gander at.
 

Attachments

  • VB - Debug.jpg
    VB - Debug.jpg
    81.1 KB · Views: 195
  • VB - Employment History.jpg
    VB - Employment History.jpg
    83.4 KB · Views: 181
There's a missingsignature, i.e. Private Sub line.

Did you write this code or copied it from a resource?

Can you explain what you're trying to achieve with the code?
 
I referenced it from "Access for Dummies" (fits..ahahah)

The purpose of the database, it is to mock a Human Resources Information System Database.

It holds the employee information on the top of the form, and then in the tabs it goes into more detail about said employee using a subform.

I have a table called tblemployeehistory that can link to tblemployee so it knows what to populate in this subform in the tab.

I hope I answered your question.

I appreciate your help!
 
So why not just link the subform to the parent form via the EmployeeID field?

You don't need code for this.
 
Also the Set... and the recordset assignment need to be in the form load not in the declarations section
 
Click the subform control once, in the property sheet you will see a property called Link Master Fields, click the button that appears in that row and select from the drop down the EmployeeID fields.
 
Thank you for your excellent help, I stepped away for a bit and deleted the code and the current subforms and redid the subforms.

Poof! Fixed.

Carrie:D
 

Users who are viewing this thread

Back
Top Bottom