Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
  1. #16
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,625
    That is VBA code to execute an SQL action statement. No Access query object is involved.



    It doesn't work because variables must be concatenated. Reference to control on form is a variable. I prefer CurrentDb.Execute method:

    CurrentDb.Execute "UPDATE wrkTable SET Chosen=True WHERE Department = '" & Forms!EdEnroll!Department & "'"
    Forms!EdEnroll.Requery

    If Department is a number field, remove the apostrophe delimiters.

    Run Debug>Compile to catch VBA code syntax errors but it will not catch errors in SQL statements.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  2. #17
    Canadiangal is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Sep 2009
    Posts
    81
    Thank you very much for your help!
    Last edited by Canadiangal; 03-05-2013 at 12:42 PM. Reason: wrong entry

  3. #18
    Canadiangal is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Sep 2009
    Posts
    81
    June, I just noticed that my on combo field is cutting off the data. So I have an unbound field called combo 19. I have four fields that have the following values:
    =[combo19.[Column(1)]
    =[combo19.[Column(2)]
    =[combo19.[Column(3)]
    =[combo19.[Column(4)]

    My =[combo19.[Column(4)] pulls from the query based on combo 19 which is my notes field. In the query, the data is all there. However, when I pull column 4 it cuts off the data. Any work around for this?

  4. #19
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,625
    Notes field is memo type? Combos truncate memo field type data.

    One way to handle might be a subform.

    I would have to know more about data and form structure.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 12-04-2012, 02:46 AM
  2. Report Based on 2 Queries
    By cbgroves in forum Reports
    Replies: 7
    Last Post: 12-15-2011, 07:11 AM
  3. Replies: 3
    Last Post: 02-22-2011, 01:28 PM
  4. Multiple Choices for Parameters with VBA and Queries
    By weasel7711 in forum Programming
    Replies: 3
    Last Post: 02-02-2011, 09:19 AM
  5. Send parameters to queries
    By Merkava in forum Programming
    Replies: 8
    Last Post: 11-06-2009, 02:31 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