Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2003
    Posts
    32

    Unanswered: opening a form in different modes

    Hiiii

    I have one main form. i am using that form to add , update and view records .

    The structure of the form should be changed depending on the option selected. i.e., while adding and updating records some combo boxes should be displayed and while viewing records they should not.

    And while updating and viewing, the fields in the form should be filled while the form is being opened.

    I am using switchboard in access 2000.

    Please help me in this matter.

    Thanks

    Krishna

  2. #2
    Join Date
    Nov 2003
    Posts
    1,487
    Hmmmm....I think (?) I know what you are trying to accomplish.
    Perhaps this:


    Private Sub Form_Current()
    If Me.NewRecord Then
    Me.Combo1.Visible = False
    Me.combo2.Visible = False
    Me.textbox1.Visible = False
    '.....etc.
    '.....etc.
    Else
    Me.Combo1.Visible = True
    Me.combo2.Visible = True
    Me.textbox1.Visible = True
    '.....etc.
    '.....etc.
    End If
    End Sub

  3. #3
    Join Date
    Jun 2003
    Location
    Belgium
    Posts
    133
    You should have a different opening style for the two ways of looking at the form.
    For this, you'll need 2 buttons on your switchboard :
    1 : View Records
    2 : Edit / Add records

    The first button opens your form as read only and hides the combo's (suppose there are 3) that should not be seen :
    DoCmd.OpenForm "frmFormName", acNormal, , , acFormReadOnly
    Forms!frmFormName!cboCombo1.Visible = False
    Forms!frmFormName!cboCombo2.Visible = False
    Forms!frmFormName!cboCombo3.Visible = False

    Second button opens the form normal so the user can edit the records :
    DoCmd.OpenForm "frmFormName", acNormal


    It's as easy as you make it!

Posting Permissions

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