Results 1 to 4 of 4
  1. #1
    Join Date
    May 2006
    Posts
    11

    Unanswered: help in multiple instance form

    how can i get the value of a field in my main form and automaticall display it to the same field in my multiple instance form?

    i have a form(main form) and i have this field named purchased date now i have a button named new that when click will call a multiple instance form. Now what i want to do is that when i type a date on my purchased date and click the new button to call my instance form the date i have typed in my main form will also display automatically in my multiple instance form.Thanks

  2. #2
    Join Date
    Nov 2003
    Posts
    1,487
    One way is to use the OpenArgs property. Use something like this to open your form(s):

    Code:
     
    If IsNull(Me.PurchaseDate) = False Then
       DoCmd.OpenForm "myFormName", , , , , , Me.PurchaseDate
    Else
       DoCmd.OpenForm "myFormName"
    End If
    Then in the OnOpen event for the Form being opened have something like this:
    Code:
    If Me.OpenArgs <> "" Then
      Me.PurchaseDate = Me.OpenArgs  ' or CDate(Me.OpenArgs) or whatever.   
      Me.OpenArgs = ""
    End If
    .
    Environment:
    Self Taught In ALL Environments.....And It Shows!


  3. #3
    Join Date
    May 2006
    Posts
    11

    help

    where would i put the codes?...im really not familiar with multipleinstance form.i need ur help thanks

  4. #4
    Join Date
    Nov 2003
    Posts
    1,487
    To call a Multiple Instance of the same form do the following:

    Place this into the Declarations section of the Form we want to make multiple instances from (under the Option Compare Database or Option Explicit). This would be your template From so to speak:

    Dim Frm as Form

    Place the following into the OnClick event of a Command button on the same Form:
    Code:
    If IsNull(Me.PDate) = False Then
       Set Frm = New Form_AssetManagement
       Frm.SetFocus
       DoCmd.RunCommand acCmdRecordsGoToNew
       Frm.PDate = Me.PDate
    End If
    This will create another instance of your Form, start a New Record and automatically place the Purchase Date from the previous record into the New Record on the new Form Instance.

    Enjoy...

    .
    Environment:
    Self Taught In ALL Environments.....And It Shows!


Posting Permissions

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