Type Mismatch during Setvalue macro

M

majin_grohl

I have a subform (ACTIVITIES) within a form (END USER), which has
‘Distributor ID’ in the field list but not on the form. I have ‘Distributor
ID’ in the field list of the parent form (END USER), which is selected using
the row source of a combo box. The combo box takes the information from a
linked table and puts it into the ‘Distributor ID’ field in the table. When
I select a distributor, the ‘END USER’ table is updated, then when I add a
new activity I have a setvalue macro on the Subform so that when a new record
is created, it adds the distributor ID to it. The condition is that The
‘ENDUSER ID’ in the ‘ACTIVITIES’ form fields list is equal to the ‘ENDUSER
ID’ in the ‘END USER’ form. At the moment this creates a ‘TYPE MISMATCH’
error.
I took away the condition and now I get ‘An error occurred while referencing
the object’
Does any one have any ideas.
 
K

Ken Snell \(MVP\)

I don't understand your description of your setup nor what the contents of
the macro's properties are. Can you show us the actual expressions etc.?
 
M

majin_grohl

I have some more info,

I have moved the subform into a tabcontrol in the main form and I stil
get the referencing error. A Macro runs when one of the controls i
entered, the expresions in the macro are:

Setvalue
item: [Forms]![End Users]![Activities]![Distributor ID]
expression: [Forms]![End Users]![Distributor ID]

[End Users] is the main form, [Acivities] is the subform [Distributo
ID] is the linked field in both of the underlying tables, do I need t
include the tabcontrol into the item?
Is this enough for you to help or do you need more info?

cheers, Dave
*I don't understand your description of your setup nor what th
contents of
the macro's properties are. Can you show us the actual expression
etc.?

--

Ken Snell


-
majin_groh
 
K

Ken Snell \(MVP\)

My sense is that you are using the wrong name for the subform -- you need to
use the name of the subform control (the control that holds the subform
object), whose name may or may not be the same name as the actual form that
is being used as the subform.

--

Ken Snell
<MS ACCESS MVP>

majin_grohl said:
I have some more info,

I have moved the subform into a tabcontrol in the main form and I still
get the referencing error. A Macro runs when one of the controls is
entered, the expresions in the macro are:

Setvalue
item: [Forms]![End Users]![Activities]![Distributor ID]
expression: [Forms]![End Users]![Distributor ID]

[End Users] is the main form, [Acivities] is the subform [Distributor
ID] is the linked field in both of the underlying tables, do I need to
include the tabcontrol into the item?
Is this enough for you to help or do you need more info?

cheers, Dave
*I don't understand your description of your setup nor what the
contents of
the macro's properties are. Can you show us the actual expressions
etc.?

--

Ken Snell
[/vbcol] *
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top