Copy Data from cell (1 Viewer)

Xenix

Registered User.
Local time
Today, 09:22
Joined
Oct 8, 2001
Messages
124
Why don't this work?

Me.Key = Forms!Customer!Key

Key is Number "Long Integer" and
Customer!Key is "Autonumber, Long integer"

I get an error message saying:
"You can't assign a value to this object"

Can anyone help me?
 

David R

I know a few things...
Local time
Today, 03:22
Joined
Oct 23, 2001
Messages
2,633
Where does Me.Key store it's data? What does it say under Data>Control Source?

My hunch is that it's not storing to anyplace, but is instead a calculation of some sort.
 

Xenix

Registered User.
Local time
Today, 09:22
Joined
Oct 8, 2001
Messages
124
Under Data control source it says "Key" it a autonumber field in my Customer table. the other one is in my quotations table and is a number value same as autonumber Long integer.
 

David R

I know a few things...
Local time
Today, 03:22
Joined
Oct 23, 2001
Messages
2,633
If Me.Key relates to an autonumber field, that is why you can't assign a value to that object. It should store to the Long Integer field.

Maybe I'm misunderstanding the question. Cacn you back up and explain what you're trying to do? Not in code, just in language, i.e. "I want to make sure this form is on the same record as my Customer form".

[This message has been edited by David R (edited 05-30-2002).]
 

Xenix

Registered User.
Local time
Today, 09:22
Joined
Oct 8, 2001
Messages
124
Ok Forms!Customer!Key is Autonumber the rest are just Number Long int.

I have a customer file, The key is giving them a unique identifier. From the customer file I generate quotations so I want to link the quotations by a key that will relate to that customer unseen by the user. All the user will see is the company name,

So when I click on quote I want to copy the number in the Key field to the Key field in Quotations.
 

David R

I know a few things...
Local time
Today, 03:22
Joined
Oct 23, 2001
Messages
2,633
You've got a basic one-to-many relationship so I'm not sure what the problem is. One customer can have many quotations, so you need to store the Customer.Key in the Quotations table..

Have you defined this relationship in Tools>Relationships? Is this form only showing the Quotations table, or is it a subform of the Customer form?
If it's a subform, check your Master/Child fields to make sure they're correct. Your subform should NOT have any fields from Customer.Key on it. It should have the Long Integer field that stores Customer.Key in Quotation.CustomerKey(FK).
If this form is Quotations by itself, try making the field a combobox, or with the lookup wizard. It should look up in Customer.Key but store in Quotation.Key.

Hope that made sense. Post back if I've made things worse.
 
Last edited:

Users who are viewing this thread

Top Bottom