Results 1 to 3 of 3
  1. #1
    d9pierce1 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2012

    Code Programing General Question

    Hi all,
    I just have a question that has bothered me for quite some time. I see this frequently and I don't understand it? Maybe someone can please explain this to me.
    Below is some code I have, I didn't write, it actually came with a zipcode db I bought for reference.

    I highlighted the area of the basic question as I see different letters before a word in code and have always wanted to know why this is there? Is there a purpose?

    What is the f for in the fFound? I don't understand the random letter in front of words in code? Please explain to me...

    Public Function GetCityState(strZip As String, strCity AsString, strState As String) As Boolean
      ' Comments:Lookup City and State based on zip code
      ' Params  : strZip          Zip code to lookup
      ' Sets    : strCity         City
      '           strState        State
      ' Returns : TRUEif zip code found, FALSE if not
      ' Created :11/15/00-LC
      ' Modified:09/15/09-LC
      Dim fFound As Boolean
      Dim strZipSearchAs String
      fFound = False
      strZipSearch =Left$(strZip, 5)
      IfLen(strZipSearch) = 5 Then
          .Index ="ZipPrimary"
          .Seek"=", strZipSearch, True
          If Not.NoMatch Then
            fFound = True
            strCity =![City]
            strState =![State]
            strCity =""
            strState =""
          End If
        End With
      End If
      GetCityState = fFound
    End Function

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Nevada, USA
    It's just part of a naming convention, just like the str preceding the string variables.

    You can see the f is for Flag. Personally I stick with 3 letter prefixes, so I use boo for Boolean variables.
    Paul (wino moderator)
    MS Access MVP 2007-2019

  3. #3
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Ontario, Canada
    @d9pierce1 - if you're writing your own, here's another one that is a bit more informative in terms of things to NOT do

    and try to stay away from reserved words
    - "doesn't work" doesn't help. Implement changes in copies of your database.
    "Everyone has a photographic memory; some just don't have film." Steven Wright

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

Similar Threads

  1. General Question
    By Gregm66 in forum Access
    Replies: 2
    Last Post: 10-05-2016, 11:10 AM
  2. General totals question
    By brownk in forum Database Design
    Replies: 8
    Last Post: 05-18-2012, 09:16 AM
  3. General Question
    By notadbadmin in forum Access
    Replies: 3
    Last Post: 08-03-2011, 08:03 PM
  4. General question
    By dollygg in forum Access
    Replies: 7
    Last Post: 12-11-2009, 05:13 PM
  5. General Database question
    By xyzz in forum Access
    Replies: 3
    Last Post: 05-20-2009, 10:28 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 - Senior Forums