Results 1 to 4 of 4

Thread: form

  1. #1
    Join Date
    Aug 2003
    Posts
    31

    Unanswered: form

    Hi all i have yet another question.

    I have a form with 4 columns to fill in.

    School, teacher, date of visit and time

    at the bottom of this form i have a button which runs an update query updating every instance of the selected school. This runs fine.

    anyway, i would also like another button which will select the data that i have input (just the 4 fields) and then put them into either a query or a new table.

    This is so i can use the data in a mail merge

    How would i do this.

    If you need any more info then please let me know.

    Matt

  2. #2
    Join Date
    Aug 2003
    Location
    SW Ohio
    Posts
    198

    Re: form

    Originally posted by mattygg
    Hi all i have yet another question.

    I have a form with 4 columns to fill in.

    School, teacher, date of visit and time

    at the bottom of this form i have a button which runs an update query updating every instance of the selected school. This runs fine.

    anyway, i would also like another button which will select the data that i have input (just the 4 fields) and then put them into either a query or a new table.

    This is so i can use the data in a mail merge

    How would i do this.

    If you need any more info then please let me know.

    Matt
    My thought - you can use the same button, just add this to it in the code

    dim db as database
    dim rs as recordset

    set db=currentdb
    set rs=db.openrecordset("mailmrgtbl") '<-- this is the table you want it to insert into

    with rs
    .Addnew
    !School = ME.School_Field.value
    !teacher = ME.teacher.value
    .....
    .update
    end with
    rs.close

    Or something substantially similar to that.
    Jim P.

    Supoorting Oracle, MSSQL7, Sybase 8, & Pervasive. Confusion Reigns

  3. #3
    Join Date
    Aug 2003
    Posts
    31

    hi jim

    Hi jim

    thanks for helping me i have a couple of questions though.

    when you say add it to the button do you mean in sql or vbasic.

    i think the button is command6 so do i just add it onto there.

    Is there any other way of doing it without using vbasic as im a very basic user of access and im not really sure what im doing.

    cheers

    matt

  4. #4
    Join Date
    Aug 2003
    Location
    SW Ohio
    Posts
    198

    Re: hi jim

    Open the form in Design Mode, select the button that you want to edit. Then click on File->Properties. On the Event Tab should have [Event Procedure] in the On Click row. Select that row and off to the right should be an icon with three dots in it . Click on that and it will take you right to the VB code that you want to enter the above procedure into.
    Jim P.

    Supoorting Oracle, MSSQL7, Sybase 8, & Pervasive. Confusion Reigns

Posting Permissions

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