Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Jul 2003
    Location
    Cincinnati, Ohio
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Pass value from one form to another (2003)

    We have a database that we use to track projects and meetings associated with those projects. On one form (frmProjects) there is a ProjectName field. On the same form I have a command button that opens frmMeetings and adds a new record. I would like to be able to start the new Meeting record with the value from ProjectName on frmProjects. On frmMeetings the field is a drop down box cmbProjectName (2 columns, ProjectID, ProjectName). Within the command button's click event I have tried adding cmbProjectName = Me.ProjectName without success. Do I have to specify the frmProjects form within the code? How might that look? Any help would be appreciated...Thank you!

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Pass value from one form to another (2003)

    I assume that cmbProjectName is bound to ProjectID, not to ProjectName, so you must set it to the value of ProjectID. And yes, if you refer to a control on another form, you must include the form in the reference:

    Forms!frmMeetings!cmbProjectName = Me.ProjectID

  3. #3
    2 Star Lounger
    Join Date
    Jul 2003
    Location
    Cincinnati, Ohio
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Pass value from one form to another (2003)

    That did it. Thanks once again Hans.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •