Results 1 to 9 of 9
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Posts
    1,119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Form Question (2000)

    I have a form that I open with a new Record. The form shows 27 records but that is because it is counting the new blank record. When I create a query from the data from this form, I get the blank record at the top. How do I prevent this? I am picking one of the fields and putting Is Not Null in the criteria but I am not sure if this field is always going to have something in it. The code is

    Private Sub Form_Load()

    RunCommand acCmdRecordsGoToNew
    End Sub

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

    Re: Form Question (2000)

    What do you mean by "When I create a query from the data from this form"?

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Posts
    1,119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form Question (2000)

    This is a data entry form so there is a table created from using this form. I use this table to create a query. The form shows 27 records but there really is only 26. When I create the query, I get this blank record at the top of the query. When I create a report using this query, I have a blank record at the top. I picked a field in the query and put Is Not Null in the criteria but sometimes this field might be null legitimately. I open the form to a blank record using code. I hope I am explaining this clearly.

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

    Re: Form Question (2000)

    When you open the form, there are already existing records, and you open the form to a new record. So I assume the form is bound to a table or perhaps to a query. You write "there is a table created from using this form". Is that a new table, other than the one the form is bound to? If so, how is the table created?

  5. #5
    5 Star Lounger
    Join Date
    Jan 2001
    Posts
    1,119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form Question (2000)

    The table that is created is a new table - that is what the form is bound to. When I put a record into the form, it is added to the table that is behind the form. It is just a form to get records into a table. I just looked at the table that is created from this form and it is showing 26 records. The form is showing 27 - it is counting the blank record that is on the screen. My query is also picking up the blank record for some reason. I can get around this by using one of the fields and putting Is Not Null in the criteria. I am fairly sure that every record will have a client name. I just thought maybe opening the form to a blank record was causing this.

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

    Re: Form Question (2000)

    what happens if you delete the blank record from the table (directly in the table itself) - does it reappear in the table/query after you open the form?

  7. #7
    5 Star Lounger
    Join Date
    Jan 2001
    Posts
    1,119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form Question (2000)

    You can't delete it. The delete symbol is grayed out. I don't know what is causing this behavior but this database is so convoluted (if that is a word) that I am ready to pull my hair out. I am just gong to say Is not null for the client name field criteria and settle for that. There should always be a client name and if there isn't so be it. It is probably something I am doing wrong.

  8. #8
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Form Question (2000)

    The record count is 27 because you are sitting on a New Record (per your code). If you point at one of the other records, the count will show 26.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

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

    Re: Form Question (2000)

    A table will always display a blank record, and a query in which data can be edited willl display one too. This does not mean that this blank record actually exists. It provides the user with a way to start a new record. As soon as the user starts entering data, a new blank record will appear.

    However, if you create a report based on the table, the blank record will not be displayed - at least it shouldn't be.

Posting Permissions

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