Results 1 to 9 of 9
  1. #1
    Madmax2 is offline Novice
    Windows Vista Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    13

    Grrr why is this wrong?


    Docmd.openform ("istatus",,,"[item#]='"&[item#]&"'"



    it keeps compiling wrong for some reason. Just trying to open a status change sheet after checking a broke item in for people to write whats wrong with it...item# is on both forms and attached to the same table...thoughts?

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    What is the data type of item. If it is numeric then the single quotes are not needed.
    Also, you should not use special characters "#" when naming objects.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    Madmax2 is offline Novice
    Windows Vista Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    13
    Aye its numerical. /sighs. Its been two years so my naming conventions were a little off...luckly i am building it as a tool checkout program and nothing in it is very intensive but if i manage a new job elsewhere i will stay away from the number sign next time.

  4. #4
    Madmax2 is offline Novice
    Windows Vista Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    13
    Still missing with the single quotes removed. The compile error is expected:=

  5. #5
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    I think you may need to change that Field Name
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  6. #6
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by Bob Fitz View Post
    I think you may need to change that Field Name
    That is what I am thinking

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    You have a stray parentheses. Try

    Docmd.openform "istatus",,,"[item#]=" & [item#]
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #8
    Madmax2 is offline Novice
    Windows Vista Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    13
    Bingo! Thanks paul

  9. #9
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Happy to help!
    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. what is wrong
    By Dinoshop in forum Access
    Replies: 1
    Last Post: 07-11-2014, 06:22 AM
  2. VBA gone wrong with an if
    By Ruegen in forum Programming
    Replies: 2
    Last Post: 10-21-2013, 05:38 PM
  3. What's wrong!
    By khalid in forum Programming
    Replies: 15
    Last Post: 06-27-2011, 06:38 AM
  4. What is wrong with this IFF?
    By bburton in forum Reports
    Replies: 2
    Last Post: 03-16-2011, 10:42 AM
  5. What am I doing wrong?
    By brandon in forum Access
    Replies: 2
    Last Post: 08-03-2008, 10:26 AM

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