Results 1 to 6 of 6
  1. #1
    rogdawg is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2010
    Posts
    5

    Form fields continue to display "#Name?" no matter what I do

    I have created a form and "connected" it to a table in my database. I have set the "Data Entry" and "Allow Additions" properties of the form to "Yes" because I want the form to simply allow users to add new records. I do not want the user to view or edit existing records from this form.

    I have defined Control Source information for each of the text fields, and when I created the form, I used the wizard functionality to define the "Add a record" functionality for the "submit" button.

    When the form is displayed, all the text fields display text reading "#Name?". The information I have found on-line says that the Data Entry and Allow Additions properties should take care of this issue but, it hasn't.

    I have also tried things like this:

    =IIf(IsNull([MyTable]![SomeColumn]),"",[MyTable]![SomeColumn])



    and

    =IIf(IsError([MyTable]![SomeColumn]),"",[MyTable]![SomeColumn])

    in the Control Source definitions of the fields, and that has no effect either.

    I suspect I have missed something in my form's setup that is causing this.

    Any help would really be appreciated.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I assume the record source of the form is MyTable? Try this:

    =Nz([SomeColumn], "")

    Make sure there isn't a textbox with the same name as a field ("SomeColumn" in this case), as that can confuse Access. You realize having a formula as a control source of a textbox will prevent the user from entering anything?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    rogdawg is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2010
    Posts
    5
    OK, so if I set the control source of the text field, it will prevent the user from entering data?
    So, to have the form add a new record, should I write code in the On_Click event of my submit button that gets the data from each form field, and puts it in a recordset so I can then update the database?

    The information I have seen in tutorials, etc seemed to suggest that I could create a form, set the Control Source of the individual controls, set the Data Entry property to "Yes" and then create my "Add Record" button (using the wizard when I created the form), and MS Access would handle creating a record when the "Add Record" button was clicked. I take it that is not correct?

    Thanks for your help

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Normally the control source of the textbox is simply the name of the field (like SomeColumn). That will let the user add data, no code necessary. As soon as you make the control source "=Whatever", you've made it something that will only display, not allow changes. Try just making each textbox control source the name of the field.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    rogdawg is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2010
    Posts
    5
    AAHHHHHH!!! That was my problem.
    I tried "=[MyTable]![SomeColumn]" and "[MyTable]![SomeColumn]" and they were both giving bad results...just putting in "SomeColumn" did the trick.
    I thought I was supposed to use the Expression Builder to enter what I wanted but, that was leading me down the wrong path.

    Thank you very much for clearing up my misunderstanding of this simple thing!

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    No problem, glad you got it sorted out. The record source of the form already told it what table, so all you need in the textbox is the field name.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 4
    Last Post: 06-14-2010, 02:31 PM
  2. Replies: 1
    Last Post: 03-26-2010, 07:20 PM
  3. Fields do not show in "Form View"
    By hawzmolly in forum Forms
    Replies: 4
    Last Post: 01-09-2010, 06:27 PM
  4. a simple "display date " query
    By Ushera in forum Queries
    Replies: 2
    Last Post: 07-31-2009, 06:49 AM
  5. Link tables on "special" fields
    By Gargen in forum Access
    Replies: 0
    Last Post: 12-18-2008, 12:02 PM

Tags for this Thread

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