+ Reply to Thread
Results 1 to 19 of 19

Arguement not found error Can't find mistake

  1. #1
    Forum Contributor
    Join Date
    10-27-2013
    Location
    Columbus Ohio
    MS-Off Ver
    Excel 2010
    Posts
    137

    Arguement not found error Can't find mistake

    Hello experts, I have an Argument not found error showing up when inserting a record in Access using VBA. Not quite sure what argument it is referring too. Any help would be appreciated. I am assuming it is an issue with the quotes but cannot find it.
    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Arguement not found error Can't find mistake

    Change that last line to:
    Please Login or Register  to view this content.
    This isnt guaranteed to fix it but I always use a variable with .Execute and the msgbox will allow you to check that the statement looks right before executing it. If not, that should lead you to the answer.

  3. #3
    Forum Contributor
    Join Date
    10-27-2013
    Location
    Columbus Ohio
    MS-Off Ver
    Excel 2010
    Posts
    137

    Re: Arguement not found error Can't find mistake

    Well I was originally signing it to a variable and then passing the variable to msgbox to verify the string looked correct and it did. I will try to pass the variable to the execute and test that way. I did it the other way for several tables and it worked just fine so I am stumped.

  4. #4
    Valued Forum Contributor ranman256's Avatar
    Join Date
    07-29-2012
    Location
    Kentucky
    MS-Off Ver
    Excel 2003
    Posts
    1,177

    Re: Arguement not found error Can't find mistake

    All this could be done using a query and zero code.

  5. #5
    Forum Contributor
    Join Date
    10-27-2013
    Location
    Columbus Ohio
    MS-Off Ver
    Excel 2010
    Posts
    137

    Re: Arguement not found error Can't find mistake

    I prefer the code, but yes I could write the query which would be almost identical. There isn't any gain using the query over VBA I don't think and there is a lot more code on the backend besides this one function.

  6. #6
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Arguement not found error Can't find mistake

    Quote Originally Posted by ranman256 View Post
    All this could be done using a query and zero code.
    have to admit (rightly or wrongly) I always use code if theres anything else to do when the button is pressed, in this case it looks like the SQL is only part of the functionality.

  7. #7
    Forum Contributor
    Join Date
    10-27-2013
    Location
    Columbus Ohio
    MS-Off Ver
    Excel 2010
    Posts
    137

    Re: Arguement not found error Can't find mistake

    I agree pj, I tend to use code over built in functionality of Access.

  8. #8
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Arguement not found error Can't find mistake

    hi,
    As @pjwhitfield had suggested , what was the output of the sql statement ?
    Happy Computing ,

    Xlbiznes.

    To show your appreciation please click *

  9. #9
    Forum Contributor
    Join Date
    10-27-2013
    Location
    Columbus Ohio
    MS-Off Ver
    Excel 2010
    Posts
    137

    Re: Arguement not found error Can't find mistake

    This is the output: "INSERT INTO DailyYardWalk (walkDoneBy, time, driversWaiting, overnightParking, personalCars, notes) VALUES('Jon','1:45:03 PM','-1','0','0','Jon');"

  10. #10
    Forum Contributor
    Join Date
    10-27-2013
    Location
    Columbus Ohio
    MS-Off Ver
    Excel 2010
    Posts
    137

    Re: Arguement not found error Can't find mistake

    I am trying to insert 1, and 0 for a yes/no datatype. Could that be the issue?

  11. #11
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Arguement not found error Can't find mistake

    I think you need to eliminate the quotes for the yes and no field type . just -1 or 0

  12. #12
    Forum Contributor
    Join Date
    10-27-2013
    Location
    Columbus Ohio
    MS-Off Ver
    Excel 2010
    Posts
    137

    Re: Arguement not found error Can't find mistake

    I have done that and still get the same error. Here is the output with the quotes removed. "INSERT INTO DailyYardWalk (walkDoneBy, time, driversWaiting, overnightParking, personalCars, notes) VALUES('Jon','1:45:03 PM',-1,0,0,'Jon');"

  13. #13
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Arguement not found error Can't find mistake

    try replacing -1 with false and 0 with true.

  14. #14
    Forum Contributor
    Join Date
    10-27-2013
    Location
    Columbus Ohio
    MS-Off Ver
    Excel 2010
    Posts
    137

    Re: Arguement not found error Can't find mistake

    Ok, everything I have seen states it is a Boolean type leading to -1 and 0. I will try True and false to see and get back with you.

  15. #15
    Forum Contributor
    Join Date
    10-27-2013
    Location
    Columbus Ohio
    MS-Off Ver
    Excel 2010
    Posts
    137

    Re: Arguement not found error Can't find mistake

    Updated value and still getting same error messaage. "INSERT INTO DailyYardWalk (walkDoneBy, time, driversWaiting, overnightParking, personalCars, notes) VALUES('Jon','2:16:04 PM','True','False','False','Jon');"
    I have tried romoving the quotes as well as changing the datatype from string to Boolean.

  16. #16
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Arguement not found error Can't find mistake

    Dont you need # around the time data?

    #2:16:04 PM#

  17. #17
    Forum Contributor
    Join Date
    10-27-2013
    Location
    Columbus Ohio
    MS-Off Ver
    Excel 2010
    Posts
    137

    Re: Arguement not found error Can't find mistake

    So I found out the issue. I had one of my fields in the table named Time. Time is a reserved word which wouldn't allow the query to run. Sooooooo, the query itself was correct and I just screwed up in the initial DB design. Thanks for all of you help

  18. #18
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Arguement not found error Can't find mistake

    How did none of us spot that?!?!?!?!?

  19. #19
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Arguement not found error Can't find mistake

    You should still be able to use [time] in the query, but yes better to rename the field.
    Remember what the dormouse said
    Feed your head

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Error 2023 - triggered by variable - Cant find mistake
    By Taktiker in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-22-2012, 09:11 AM
  2. [SOLVED] Errorcode 91: Can't find my mistake
    By flo.111 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-01-2012, 08:37 AM
  3. Run time error '5': Invalid procedure call or arguement (excel 2007)
    By Excel_novice1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-05-2012, 05:40 PM
  4. error 'Invalid Procedure Call or Arguement'
    By chrismann85 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-09-2009, 07:28 AM
  5. [SOLVED] Found Mistake can't correct.
    By dvonj in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-21-2005, 05:06 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1