Results 1 to 4 of 4
  1. #1
    markjkubicki's Avatar
    markjkubicki is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Jul 2010
    Location
    Fire Island Pines, NY
    Posts
    496

    stuck on a simple dcount()

    stuck ....that simple


    and any suggestions / comments / criticisms will be more than welcome in advance

    Code:
    Sub ShowUserRosterMultipleUsers()
    Dim intUserCnt As Integer
    Dim str_BE_FileName As String
    Dim str_BE_lookup As String
    
         'get the name of the current backend file
        str_BE_FileName = Right(linklocation("tbeFixtureTypeDetails"), 255)
        
        'count number of users who have are logged into the file; 
        'a visual check of the table where a list  active users is stored shows only one record and the file name matches
        intUserCnt = DCount("User_name", "tblUserFile_Log", "FileLink_BE_proj = "" & str_BE_FileName & """)
        'yet the count is 0 
     
        '<<<--THAT IS WHERE I'M STUCK -->>>
        
        ' since there is only 1 record in the table, so lets take  look at it's value
        str_BE_lookup = DLookup("[FileLink_BE_proj]", "tblUserFile_Log")
        ' and check if it equals the file i am checking for
        MsgBox str_BE_FileName = str_BE_lookup
        ' it does  "true"
    
    End Sub

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,914
    Strings need to be surrounded by single quotes ' unless it contains a single quote, then triple double quotes works I think?


    Dates with # and in mm/dd/yyyy or yyyy-mm-dd format


    Numbers do not need anything
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    markjkubicki's Avatar
    markjkubicki is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Jul 2010
    Location
    Fire Island Pines, NY
    Posts
    496
    oy
    i should be embarrassed

    ntl
    thnx much

  4. #4
    kd2017 is offline Well, I tried at least.
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    1,142
    Double quotes are fine too. You were just missing one or two.

    "FileLink_BE_proj = """ & str_BE_FileName & """"

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

Similar Threads

  1. Replies: 2
    Last Post: 11-10-2017, 07:52 PM
  2. Simple but m stuck totally
    By Abdulcute in forum Access
    Replies: 1
    Last Post: 01-14-2017, 01:43 AM
  3. Replies: 1
    Last Post: 10-16-2013, 09:19 AM
  4. Probably a simple solution, but I am stuck
    By ANC-AB in forum Queries
    Replies: 3
    Last Post: 04-29-2012, 10:05 PM
  5. A Simple DCount Tbo . . . hopefully!
    By mseeker22 in forum Forms
    Replies: 1
    Last Post: 06-28-2011, 08:42 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