Results 1 to 2 of 2
  1. #1
    aligahk06 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Apr 2010
    Posts
    94

    Two same fields in a form Print & Save command?

    DEAR ALL,


    I have a form generated from table fields.
    There are two fields that is same,say PO number.
    I want if i update PO number at one place then the same PO number field automatically updated .
    No need to enter two times PO number at two different field.

    Moreover, I want a print command i and a save command in my form.
    Any Help?



    Rgds,
    Aligahk06

  2. #2
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    First of all you can have two fields with the same name in a table, query.
    You cannot have Controls (TextBoxes with the same name in forms)
    The text Boxes in the forms have a Name and a Control source.

    While the Name cannot be the same the controlsource of two text box in a form may have the same ControlSource.

    Name is the identifier by which a control on a form is identified. Controlsource is the Field of a table to which the text Box control is linked.

    So go to the properties of the Text Boxes and make the controlsources the same.

    Now Changing the label of a text box in a form doesnot change the the Name of the text box nor the control source of the text box.

    This code will print the active form. While creatin command buttons access wizard gives you the option to create print buttons. Try it out

    Private Sub Command9_Click()
    On Error GoTo Err_Command9_Click

    Dim stDocName As String
    Dim MyForm As Form

    stDocName = "Form1"
    Set MyForm = Screen.ActiveForm
    DoCmd.SelectObject acForm, stDocName, True
    DoCmd.PrintOut
    DoCmd.SelectObject acForm, MyForm.Name, False

    Exit_Command9_Click:
    Exit Sub

    Err_Command9_Click:
    MsgBox Err.Description
    Resume Exit_Command9_Click

    End Sub

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 01-29-2010, 11:33 AM
  2. Save and Go to another form - simple yes?
    By durstlaw in forum Forms
    Replies: 1
    Last Post: 12-15-2009, 12:46 AM
  3. Replies: 4
    Last Post: 04-01-2009, 11:48 AM
  4. Form requesting to save changes
    By stevo2820 in forum Forms
    Replies: 0
    Last Post: 07-30-2007, 07:41 AM
  5. Save only 3 of 4 fields
    By Schwagr in forum Forms
    Replies: 0
    Last Post: 03-24-2006, 05:20 PM

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