Results 1 to 7 of 7

Thread: Form Operations

  1. #1
    Join Date
    Aug 2007
    Posts
    9

    Unanswered: Form Operations

    Hi,
    I am currently using a form on my database that shows customer data, e.g. Unique i.d. code, Name, Number. On that form itself, there is a button that i have created that will open a secondary form related to that specific customer. That form also has the unique i.d code, name and number fields, i want them to be filled in automatically, based on the previous form. I have been informed that the best way to it is to write code in the "before insert" properties source. I am a little stuck, if anyone out there understands the problem, please could you provide some help.

    Kind Regards,

    t1ish

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Is the second form bound?
    Is there a foreign key relationship between the two datasets?
    If so, the simplest method may be to use
    Code:
    DoCmd.OpenForm "FormName", , , "WHERE primaryKey = " & Me.txtForeignKey.Value
    George
    Home | Blog

  3. #3
    Join Date
    Aug 2007
    Posts
    9
    Hi,
    Thank you for your post. Both the forms are bound. Both of the forms use a primary key, but i do not understand what you asked me about "a foreign key relationship between the two datasets"? In the mean time i will try the code.

    Hi, i have just tried the code and it doesn't seem to work with what im trying to, have you got any further idea's?

    Kind Regards,

    t1ish
    Last edited by t1ish; 08-15-07 at 10:21.

  4. #4
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    How do the records relate to eachother?
    George
    Home | Blog

  5. #5
    Join Date
    Aug 2007
    Posts
    9
    The records relate to eachother using a primary key. The 5 fields in the first form are also in the second form, but just as a point of reference. Hope that helps.

  6. #6
    Join Date
    Jun 2004
    Location
    Seattle, WA
    Posts
    601
    How did you make both forms? You may have to add those fields into the control source for the second field...
    Ryan
    My Blog

  7. #7
    Join Date
    Aug 2007
    Posts
    9
    Both forms were made using the wizard which has a table affiliated to it in order to hold the data. I simply need the data in 5 of the fields in form 1 to automatically appear in the second form when it is opened. I think i have to generate some code in the "before insert" properties box in the second form...but im not sure how to do this. If anyone can help, that would be really good.

    Kind Regards,

    t1ish

Posting Permissions

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