Do you still have the MsgBox in place?
Do you still have the MsgBox in place?
Did you go to bed?
Not yet
Do both forms have to be open? The tables are linked,
This should not be that hard. I am sure the code is correct.
Should I filter on the Source Field?
Bob
Yes, both form need to be open. Only Open forms are listed in the FORMS collection. Is the MsgBox still in place and does it now show a value?
Value is Null
The value is an AutoNumber, right? Try this:
MsgBox Me.[CARNumber].Text
Forms![NCRform]![CAR#] = Me.[CARNumber].Text
Sorry I have been out with Pneumonia.
Ok Here is where I stand I did screw up a few things.
"Non-Conformance Form" Is the Main Form
On that Form is a Field called "NCRNumber"
I have a Button Called NEW CAR which opens the Form
"Corrective Action Form2" When it opens I need the Value of the
Field "NCRNumber" from the Form "Non-Conformance Form" to populate the the Field "NCRnumber" on the Form "Corrective Action Form2"
I thought this would work.
Forms![Non-Conformance Form]![NCRNumber] = Me.[NCRNumber]
Sorry for the confusion ..
Bob
Sorry you were sick.
On the line *after* you open the [Corrective Action Form2] you need:
Forms.[Corrective Action Form2].NCRNumber = Me.NCRNumber
...assuming NCRNumber is the name of the *control* on each form.
Thanks it was not fun...
Ok I did get it to work using the following
me.ncrnumber= [Forms]![Non-Conformance Form]![ncrnumber]
I had to add it to a button because on load did not work.
But it only works when the Form is manually opened. If i open the form from the menu click the button to copy the field I get this
Databse can not find the referenced form "Non-Conformance Form"
Goes to debug point to the line me.ncrnumber= [Forms]![Non-Conformance Form]![ncrnumber]
IS that normal?
Both forms need to be open for your code to work.
They are both open and it does work as long as I do not call the form from the menu I created. Which I do not understand why because they menu just calls the form?
I am having a similar problem calling a report form the menu that it does not print the whole report but yet if i call it manually it prints correctly.
Bob
Remove the brackets from all but the form name in your code:
Me.NCRNumber= Forms![Non-Conformance Form]!NCRNumber
Nope did not wrok.
Is it possibel the form is on the screen but not opened?
Is there a way to make sure the form is opened?
It has to do with the menu because like I said it works fine when you manually open it but not from the menu??
Weird?
From the Non-Conformance Form I have a "Add New Record:" button with the following code
DoCmd.OpenForm "Corrective Action Form2", , acNormal, acFormAdd
It opens fine but when I execute the following code
me.ncrnumber= [Forms]![Non-Conformance Form]![ncrnumber]
It bobms out unless I opn the Non-Conformance Form manually then all is well
Ok I figured it out. Does not make sense to me but it works.
From my Navigation Form the Non-Conformance Form Button
Property Sheet | Target Name = Non-Conformance Form
Instead of doing ti that way I I just change it to the DO Open Command from The Button it works.
Anyways thanks, for All your help...
Can you post you db? Something is not right. Compact and Repair first then zip then attach to a post.