Results 1 to 3 of 3
  1. #1
    Join Date
    May 2019
    Posts
    65

    WhereConditions in DoCmd.BrowseTo functions

    I have the following code:
    1. The first code segment works. It is contained within a function which passes a value (Long Integer) to TempVars!TempContactID. The form opens with the correct record.

    Code:
     DoCmd.Browseto acForm, "frmContactsMain", "frmSCD.NavigationSubForm", "[ContactID]=" & TempVars!TempContactID, ""

    2. The second code does not worked and I've tried several different iterations of it. It's value comes from the same function and BUT it is a STRING variable - TempVars!FNumber. The form opens but there is all fields are empty.


    There are no load or open even events for the new form and there are no datatype mismatches.

    Code:
    
    It always happens, as soon as I post the thread, I discover the issue.   The problem was that in the form that was being opened in the query the FNumber field had a Criteria which was competing with the where condition.  It works fine when I delete it. 
     
      DoCmd.Browseto acForm, "frmFacilityOwnersMain", "frmSCD.NavigationSubForm", "[FNumber]= '"& TempVars!TempFNumber & "'", ""
    My idea would be that the where condition in my second code is not "wrapped" correctly.
    Any other ideas?
    Last edited by jeffhanner10@gmail.com; 04-06-2020 at 10:38 PM. Reason: Solved

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    just a comment - the parameters are optional - so your don't need ,"" at the end.

  3. #3
    Join Date
    May 2019
    Posts
    65
    Quote Originally Posted by Ajax View Post
    just a comment - the parameters are optional - so your don't need ,"" at the end.
    Yes. Thank you.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Navigation Control - Browseto Command
    By neil_va in forum Forms
    Replies: 0
    Last Post: 03-14-2016, 01:49 PM
  2. Docmd.browseto where condition
    By mjdemaris in forum Forms
    Replies: 5
    Last Post: 02-16-2016, 03:33 PM
  3. BrowseTo isnt available now HELP!
    By fluffyvampirekitten in forum Access
    Replies: 1
    Last Post: 11-17-2015, 11:04 AM
  4. Replies: 8
    Last Post: 06-19-2014, 04:20 PM
  5. BrowseTo and DataEntry on navigation form
    By Daimios in forum Forms
    Replies: 3
    Last Post: 06-05-2014, 07:31 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