Results 1 to 6 of 6
  1. #1
    rlbroerman
    Guest

    Blank form (2007)

    I want to open a form that is blank. I open my form and the fields in the headr are blank but the fields in the detail section are populated. What gives? Can you help, please?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Blank form (2007)

    Do you mean that you want to open the form with only a blank new record? If so, set the Data Entry property of the form to Yes (in the Data tab of the form's Properties sheet).

  3. #3
    rlbroerman
    Guest

    Re: Blank form (2007)

    That is exactly what I asked for but now I see that is not what I want. I try again.
    When I did what you suggested it worked great but now I can't enter a soc sec no or name and bring up a record. Got any suggestions.
    Thanks again for the help.
    Rick B

  4. #4
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Blank form (2007)

    Yes that is right.

    If you set the form to be Data Entry then you don't have access to existing records.

    In the code you use to open the form, you could add a line to automatically go to a new record. But I suspect that if you do that lots of new records will be created by mistake.

    A problem I sometimes encounter is this. I have a form where users can use combo boxes to search for existing records, or use a command button to create a new record. The form opens initially to the first record, based on the current sort order. The first record tends to get corrupted, because people type data into it without thinking about what they are doing.
    Solution is to Hide or Disable all controls on the form until either a selection is made with the combo boxes, or the new record button is clicked.
    Regards
    John



  5. #5
    rlbroerman
    Guest

    Re: Blank form (2007)

    Your suggestion sounds great. I changed the visible to no and it opened the form with that field gone. Is this what you are suggesting? If so how do I get it back on after I enter data in a combo box. Thanks for the help.
    Rick B

  6. #6
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Blank form (2007)

    What I am suggesting is that you set the visible property of everything you want hidden to No. This could be just a subform, or the detail section, or a number of controls.

    Then in the After Update event of the combo box you set the Visible Property (of everything you have hidden) back to True.
    <pre>Private Sub cboFindPatient_AfterUpdate()
    Dim rs As Object
    Set rs = Me.Recordset.Clone
    rs.FindFirst "[Soc Sec No] = " & Chr(34) & Me!cboFindPatient & Chr(34)
    If Not rs.EOF Then
    Me.Bookmark = rs.Bookmark
    Me!cboLastName = Me!cboFindPatient
    End If
    ' Code above is probably already there. Code below is new.
    If Not IsNull(Me.cboFindPatient) Then
    Me.Section(acDetail).Visible = True
    Else
    Me.Section(acDetail).Visible = False
    End If
    End Sub

    </pre>


    The code above assumes it is the Detail Section that is being hidden/shown. If it is something else replace me.section(acDetail) with the name of what you want to show/hide.
    Regards
    John



Posting Permissions

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