Results 1 to 4 of 4
  1. #1
    wptaylor4 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2013
    Posts
    9

    #name? on form text box

    I am setting up VBA to run multiple append queries in consecutive order. The append queries are supposed to pull a four digit number off of a form that will allow them to know which data to append. I want the number to be stored as text to correspond with the tables I am working with, but I am having trouble getting the form to work.



    Here is how I would like it to work:

    I enter my 4 digits in the text box on the form. Say "1305" for May 2013. I want to then run my vba (my queries update using the forms!txtupdatequery!textbox I have put in the criteria of the queries) and all of them run.

    Is anybody able to help with that? I enter my date (as a number but I want it to be text) and the form gives me a #name? error.

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    You're leaving something out but I don't know what it is.

    You enter 1305 in a text box on a form
    You run a series of append queries (which you say all run, does that mean they all run correctly?)
    <something is missing here>
    you're getting a #name? error but you don't mention where, is it on a table, a query, a report?
    typically this happens when you try to perform an operation on an incompatible data type, for instance trying to do something like AAAA + 42

    you can change the nature of your string using the cstr() to change something to a string value or cint() or cdbl() to change a string to a numeric value.

    Check the properties of your text box on your form, does it say numeric? if it does you're going to want to change it to text.

  3. #3
    wptaylor4 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2013
    Posts
    9
    Hi, sorry, let me try and clarify.

    I have 13 append queries that I would like to run back to back each month. They normally update from a parameter that asks for the period (for example, 1305). I am trying to change them to all run off of a form where I can enter the period into a text box once and and not have to do it 13 times ([forms]![txtupdatequery]![textbox]). I will then use vba to update them all in a row with one click (docmd.openquery(queries 1 through 13)). However, I am having trouble with the execution. When I close my form the #name? comes up, and my when my queries run random parameter boxes are still popping up.

    I want to make it so that I enter my number (ex 1305) in my form, start my module (all the docmd.openqueries), walk away and they will append. Is there any way to do that? Is the name thing just something that will happen after I close and re-open the form?

  4. #4
    wptaylor4 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2013
    Posts
    9
    I am actually starting to realize that this is not really my problem. I believe I will start a new thread (with more clarity). This one can be deleted.

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

Similar Threads

  1. Replies: 9
    Last Post: 03-22-2013, 06:37 AM
  2. Replies: 3
    Last Post: 12-22-2012, 05:33 PM
  3. Replies: 7
    Last Post: 10-17-2012, 11:59 AM
  4. Replies: 2
    Last Post: 03-01-2012, 12:21 PM
  5. Replies: 15
    Last Post: 09-18-2010, 01:19 PM

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