Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2002
    Location
    MA
    Posts
    10

    Unanswered: Upon Entering Form have Text Boxes Empty

    Hello

    This mysterious problem has been eluding me for days now. If you have any advice please explain in lamens terms as I am not proficient with VB.

    What I am trying to achieve is when I open a form to have the text boxes in that form to be empty. Currently when I open my form the text boxes are showing the first record from my table.

    What I have done in the past to get this to work is go into the properties of the text box and under the Data tab look for a data entry selection and change it to either yes or no (can't remember which). For some reason when I look at the properties in these text boxes the option is not even there.

    Why is this and how can I solve this problem?

    Thanks in advance for any advice.

    Renee

  2. #2
    Join Date
    Oct 2001
    Location
    Chicago
    Posts
    440
    That is a property of the form.

    Matt

  3. #3
    Join Date
    Sep 2002
    Location
    MA
    Posts
    10

    Found Data Entry..and emptied text boxes..but!

    You are right Matt..I figured this out a few minutes ago..but now I am posed with another problem.

    Now when I enter the form the text boxes are blank..Superb!..but
    I can't look up a record...the form is now exclusively a data entry form.
    How can I have the text boxes blank upon opening the form and be able to enter new records and find records aswell??

    I have a smaller database in which I can do this and have exhausted myself comparing properties from one form that works correctly to the one being stubborn..so I know that I can get both these functions to work..I just must be missing something.

    Could it have anything to do with the fact that I am using a tabular layout?

    R

  4. #4
    Join Date
    Oct 2001
    Location
    Chicago
    Posts
    440
    you can go to a new record in the open or load event

    Private Sub Form_Load()
    DoCmd.GoToRecord , , acNewRec
    End Sub


    or if calling form from another form
    DoCmd.OpenForm "<FormNameHere>", , , , acFormAdd

  5. #5
    Join Date
    Dec 2002
    Posts
    4
    I am using the code below but have a different problem. the form opens to a new record but when I use the toolbar at the bottom of the form to cycle through previous records the data does not populate. I have checked the table and the records are in there. Any ideas???

    Thanks.

    Originally posted by Rockey
    you can go to a new record in the open or load event

    Private Sub Form_Load()
    DoCmd.GoToRecord , , acNewRec
    End Sub


    or if calling form from another form
    DoCmd.OpenForm "<FormNameHere>", , , , acFormAdd

  6. #6
    Join Date
    Oct 2001
    Location
    Chicago
    Posts
    440
    I am assuming that you are talking about this code:
    DoCmd.OpenForm stDocName, , , , acFormAdd

    acFormAdd opens the form in DataEntry mode - only for adding new records. Same as [FormName].DataEntry = True. So Me.DataEntry = False would restore your ability to cycle through the records in the underlying datasource.

    Matt

Posting Permissions

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