Results 1 to 3 of 3
  1. #1
    markjkubicki's Avatar
    markjkubicki is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jul 2010
    Location
    Fire Island Pines, NY
    Posts
    496

    simple syntax for putting a variable into a function

    how would shoud I write this function where the name of the form is a variable : "strCurrentEntryForm" ?


    (this should be a no brainer... but maybe I have no brain left LOL !)

    Dim strCurrentEntryForm As String
    If <...>
    strCurrentEntryForm = "frmSpec"
    End If

    varX = Nz(DLookup("[Rep Agency]", "Manufacturers", _
    "[ManufacturerName] = """ & Forms![strCurrentEntryForm].[Manufacturer] & """"))

    many thanks in advance,
    Mark

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    varX = Nz(DLookup("[Rep Agency]", "Manufacturers", "[ManufacturerName] = """ & Forms(strCurrentEntryForm).[Manufacturer] & """"))
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    markjkubicki's Avatar
    markjkubicki is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jul 2010
    Location
    Fire Island Pines, NY
    Posts
    496
    exactly
    thnx !

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

Similar Threads

  1. simple syntax ?
    By markjkubicki in forum Queries
    Replies: 2
    Last Post: 10-09-2012, 10:31 AM
  2. simple SQL syntax with hyperlink
    By markjkubicki in forum Programming
    Replies: 2
    Last Post: 01-18-2012, 06:58 PM
  3. Simple Syntax Help
    By cvegas in forum Programming
    Replies: 7
    Last Post: 04-20-2011, 01:46 PM
  4. Long Variable syntax
    By eww in forum Programming
    Replies: 5
    Last Post: 02-10-2011, 03:34 PM
  5. simple syntax question
    By markjkubicki in forum Programming
    Replies: 6
    Last Post: 09-14-2010, 04:13 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