LinkChildField / LinkMasterField Help

maxxximaniac

Registered User.
Local time
Today, 13:31
Joined
Oct 22, 2004
Messages
80
Hey All,
I can't seem to get this to work. I've attached a copy of what im
trying to do in a DB.

What I want is for an employee to pick his name from a combo box in the
subform. I want the name to copy onto a field on the Main form so I can
write it into the Recieved Table.

I'm hoping someone can help me out with what I'm doing wrong..
Any help would be great.
http://www.zaiderman.com/db4.mdb

Thanks in advance!
 
Maxxx,

If you ZIP into a file, you can attach here.

hth,

Wayne
 

Attachments

So this is the only thing that was changed?

Code:
Forms![Frm_Main]![Employee] = Me.Combo0

Thank you very much!
 
Combobox

I got it to work for you.
Look at the code in the After Update Event of the Combo box, that is where it happens.

I don't understand though why you have the combobox on a subform,
it makes more sense to have it on the main form.

Good Luck.
 

Attachments

thanks to you both,
the reason behind it is because the mainform is the one writing the record... I want the selection to be made on the subform because I dont want the subform to update... The employee will be making many records and i dont want that person selection the name each time
 
Maxxx,

Yup, that's all that was changed. Sorry to be so brief.

I do agree with TruckTime though. The intent of a subform is usually to
allow for maintaining many related records. If you have multiple records
on your subform, you will keep over-writing the entry on the main form.

The unique values on the subform are easy to obtain through queries
for your reports, etc. You shouldn't have to "push" them onto your
main form.

Wayne
 
I applied it to the actual DB I needed it on but It yielded to another problem...
The Employee Field on the mainform is not updated unless the name was chosen on the combo box.

I attached the real one here...
Use the SHIFT to open it and the form im using is "NewForm"

If you can aid me with this I would most appreciate it.

This one was too big to attach

http://www.zaiderman.com/Payment.rar
 
Maxxx,

Crap! I can't look at the .rar file (not registered here at work).

I'll look at it at home later.

In the meantime...

The initial method will do nothing for existing data.

You could use the OnCurrent event on the subform to move it, but
then you will have to go to each record.

You could use a simple sql:

Code:
Update MainTable
Set    Employee = (Select Employee 
                   From   ChildTable
                   Where  MainKey = ChildKey)

But, that won't work if you have multiple child records (you should) and
it illustrates that the field should really be in the Main table anyway.

I'll look in on this later.

Wayne
 
I appreciate the help Wayne!
Here is the file in zip format for your convenience...
I'm not really following what you meant

While you're at it... im also trying to fix a record problem...
when the employee is finished entering the loan number, check number and amount, if they dont tab again... it wont take them to the next loan. They have to tab and complete the record then press "Next Loan"

http://www.zaiderman.com/Payment.zip
:)

Thanks again!
 

Users who are viewing this thread

Back
Top Bottom