Page 2 of 2 FirstFirst 12
Results 16 to 25 of 25
  1. #16
    graccess is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2014
    Posts
    78
    Disregard my last post. Sometimes keeping it simple works better... I used a simple double click command on each field name and created a form based on the query. I had to make the form modal because I can't seem to requery the second form or fresh it unless I close and reopen it but that actually works fine with the workflow. I'm not sure exactly why the form works correctly now populating based on what I clicked though. Thanks again for your time and assistance!

  2. #17
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    When you are testing code created in VBA it is a good idea to click "Debug" when there is an error and make note of the first line of code that caused the exception.

  3. #18
    graccess is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2014
    Posts
    78
    Well I'm back... it worked well until I realized the 2nd form wasn't effectively displaying the clicked record from the 1st form. Didn't have enough data stored to pick it up until now. So I'm back to using the code you showed me. I tried implementing it but I'm receiving the error 2465, application defined or object-defined error. See post #15 for my updated code. Any idea where I could be going wrong? thanks.

  4. #19
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    When you are testing code created in VBA it is a good idea to click "Debug" when there is an error and make note of the first line of code that caused the exception.

  5. #20
    graccess is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2014
    Posts
    78
    Apologies. Should have included that. It's getting hung up on the If statement.
    If Forms!frmUserResearch.Forms.[cboRTicker].Value = Null Or Forms!frmUserResearch.Forms.[cboRIndustry].Value = Null Or Forms!frmUserResearch.Forms.[cboRSubsector].Value = Null Then

    The cbo fields are my filter combo box controls from the main form.

  6. #21
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Give this a try. The code I wrote out would be more appropriate for subforms and is not correct. Thanks for testing it.

    If Forms!frmUserResearch.[cboRTicker].Value = Null Or Forms!frmUserResearch.[cboRIndustry].Value = Null Or Forms!frmUserResearch.[cboRSubsector].Value = Null

    Also, you will need to remove FORMS after the form name in the other lines

    Forms!NameOfMainForm.NameofControl1.Value

  7. #22
    graccess is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2014
    Posts
    78
    Getting a syntax error on a couple of the fields, 3075 (missing operator) in the query expression. I think we're referencing these fields as numbers but they're actually text values. assuming that's causing the error. how would you rewrite the code to reflect text?
    Also, in the new form, I'm currently using as the record source for the form my query which runs on the 1st form. Is this correct or should it be left blank?

  8. #23
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I do not understand what this means.

    "Getting a syntax error on a couple of the fields,"

    Is there VBA that is causing the error or is it a query object? If it is VBA show at least the one line of code that is causing the error or a block of code and indicate which line within the block is causing the error.

  9. #24
    graccess is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2014
    Posts
    78
    run time error 3075.
    'syntax error (missing operator) in query expression '[CompanyID] = 17 and cboRTicker = AAPL AND cboRSubsector ='.

    thats the full error. i'm getting this when i run the double click command event.

  10. #25
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I am going to guess that the following is part of the error msg associated with error type 3075

    '[CompanyID] = 17 and cboRTicker = AAPL AND cboRSubsector ='.

    I will take another guess that if you continued with the "Debug" option it will take you to some VBA where you are applying criteria to an object. If this is the case, you will need to know which line(s) of code need to be fixed.

    If there is not a debug option then I will have to guess again and say there is a parameterized query that is not functioning correctly.

    I will consider the guess that there is an issue with the VBA. So, you will need to fix the VBA. Perhaps the VBA is set up to handle numbers and not text (as you mentioned). Text needs to be enclosed in quotes. You can concatenate quotes into a string that includes your control(s)/variable(s).

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

Similar Threads

  1. Replies: 5
    Last Post: 06-19-2013, 08:01 AM
  2. Replies: 3
    Last Post: 12-25-2012, 12:43 AM
  3. Replies: 3
    Last Post: 09-20-2012, 11:09 AM
  4. Replies: 1
    Last Post: 05-03-2012, 02:25 PM
  5. Replies: 1
    Last Post: 03-31-2011, 12:18 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