Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21
  1. #16
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936

    Another method of finding out the exact syntax to use is to create a new query and add those fields with criteria, then copy the syntax from the SQL of the query. Access will know when to use quotes and when not to.

  2. #17
    PinkLady50 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2017
    Posts
    171
    Me.Filter = "[ContractNum] = '" & Me.cboContractNum & "'"

    I put in this code and it does not prompt for Parameter value but it is also not filtering.

    I filters fine when I go back to the Chr34 code.

    Any idea why!

  3. #18
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    No idea! I never use Chr34 and haven't seen it used either. Does it work on the TO field? Are you sure you have the correct quotes? It was incorrect in post #12.

  4. #19
    PinkLady50 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2017
    Posts
    171
    UPDATE:

    This code is now working and both comboboxes are filtering correctly. The only problem left is that the first time through I can select a ContractNum and the corresponding Task Order(TO)s come up in the cboTO. When I select a different ContractNum the values are not changing in the cboTo field. I am using a Requery in the code so I am not sure what else to do.

    Private Sub cboContractNum_AfterUpdate()
    Me.Filter = "[ContractNum] = '" & Me.cboContractNum & "'"
    Me.FilterOn = True
    Me.Requery

    End Sub
    Private Sub cboTO_AfterUpdate()
    Me.Filter = "[ContractNum] = '" & Me.cboContractNum & "' And [TO] = '" & Me.cboTO & "'"
    Me.FilterOn = True
    Me.Requery
    End Sub

  5. #20
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Requery the combobox instead of the form - Me.cboTO.Requery

  6. #21
    PinkLady50 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2017
    Posts
    171
    Thanks!!! Works like a charm!!!

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

Similar Threads

  1. Replies: 2
    Last Post: 08-22-2015, 11:26 AM
  2. Replies: 2
    Last Post: 10-15-2014, 04:23 AM
  3. Replies: 1
    Last Post: 05-24-2014, 09:08 AM
  4. Replies: 13
    Last Post: 06-12-2012, 09:52 PM
  5. Replies: 5
    Last Post: 06-10-2011, 03: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