Page 2 of 5 FirstFirst 12345 LastLast
Results 16 to 30 of 64
  1. #16
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Do you still have the MsgBox in place?

  2. #17
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Did you go to bed?

  3. #18
    bobfin is offline Advanced Beginner
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2010
    Location
    https://t.me/pump_upp
    Posts
    56

    Wink

    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

  4. #19
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    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?

  5. #20
    bobfin is offline Advanced Beginner
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2010
    Location
    https://t.me/pump_upp
    Posts
    56
    Value is Null

  6. #21
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    The value is an AutoNumber, right? Try this:
    MsgBox Me.[CARNumber].Text
    Forms![NCRform]![CAR#] = Me.[CARNumber].Text

  7. #22
    bobfin is offline Advanced Beginner
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2010
    Location
    https://t.me/pump_upp
    Posts
    56
    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

  8. #23
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    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.

  9. #24
    bobfin is offline Advanced Beginner
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2010
    Location
    https://t.me/pump_upp
    Posts
    56
    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?

  10. #25
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Both forms need to be open for your code to work.

  11. #26
    bobfin is offline Advanced Beginner
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2010
    Location
    https://t.me/pump_upp
    Posts
    56
    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

  12. #27
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Remove the brackets from all but the form name in your code:
    Me.NCRNumber= Forms![Non-Conformance Form]!NCRNumber

  13. #28
    bobfin is offline Advanced Beginner
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2010
    Location
    https://t.me/pump_upp
    Posts
    56
    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

  14. #29
    bobfin is offline Advanced Beginner
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2010
    Location
    https://t.me/pump_upp
    Posts
    56
    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...

  15. #30
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Can you post you db? Something is not right. Compact and Repair first then zip then attach to a post.

Page 2 of 5 FirstFirst 12345 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Auto-populate form question: again!
    By revnice in forum Access
    Replies: 5
    Last Post: 08-06-2010, 04:02 PM
  2. Auto-populate form question
    By revnice in forum Access
    Replies: 19
    Last Post: 08-06-2010, 01:01 PM
  3. Replies: 3
    Last Post: 10-05-2009, 07:22 AM
  4. Auto Populate Data from Main Form
    By billiejean in forum Forms
    Replies: 0
    Last Post: 08-05-2009, 08:08 AM
  5. Auto populate fields on a form
    By ldarley in forum Forms
    Replies: 0
    Last Post: 08-14-2008, 09:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums