Okay, so the ProductID is the problem.
Is there a space in the name, e.g.:
? Forms.[Form1].[Sub1].[Form].[Product ID]
Is there some other kind of object with this name?
? TypeName(Forms.[Form1].[Sub1].[Form].[ProductID])
That's the process to debug what's going on.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Reply to group, rather than allenbrowne at mvps dot org.
The names of the forms come out as they should, but when I come to
ProductID, I get the same message as before. I also tried another
fieldname,
the registered bar code that also is unique, but got the same result: "The
object does not support the property or method".
/ Rolf
"Allen Browne" <
[email protected]> skrev i meddelandet
To debug this, open the Immediate Window (press Ctrl+G), and enter the
reference gradually, until you get it. For example:
? Forms!Form1.Name
That should return "Form1".
Then try:
? Forms!Form1!Sub1.Name
That should return Sub1. If it does not, check the Name property of
the
subform control. It may be different from the name of the form loaded
into
the control (i.e. its SourceObject).
Once that's right, try:
? Forms.[Form1].[Sub1].[Form].[ProductID]
To see if you get the value of the ProductID, and so on.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Reply to group, rather than allenbrowne at mvps dot org.
Something went wrong here. I did get a message that says, when I
translate
to english, something like: "The object does not support the
property
or
method". This happens independent of if the code is placed in the
forms
After_update or in a click event for a new button.
Your 3 first mentioned assumes are right. To the last one, the
cursor
stands
on the row for a new record in the datasheet.
The same happens if the cursor is placed on an old record (even if that
was
not the intention).
/ Rolf
"Allen Browne" <
[email protected]> skrev i meddelandet
In the AfterUpdate event proecdure of the ProductID in the 2nd
form,
include
this line of code:
Forms.[Form1].[Sub1].[Form].[ProductID] = Me.[ProductID]
That assumes:
- The other form is called "Form1".
- Its subform is named "Sub1".
- The other form is still open.
- The other form has the correct record selected in the subform.
I have an order form with a datasheet-subform, where the order
specification
is made. The products are selected in a combo box. Now there