+ Reply to Thread
Results 1 to 2 of 2

form not recognizing variable defined in query

  1. #1
    Registered User
    Join Date
    01-28-2010
    Location
    Sebastopol CA
    MS-Off Ver
    Excel 2007
    Posts
    1

    Red face form not recognizing variable defined in query

    Hi there -

    My form does not seem to be recognizing a variable that I defined in a query. I'm getting a #NAME? error in the text field on the form I've created. It is not recognizing the [Minutes] variable that is created in a query. In testing I see that the values are calculating properly in the query, and that the formula in the form's text field is working if I plug in numeric values instead of the field names.

    This is the variable expression entered in the Field row of the query design grid:
    Minutes: DateDiff("n", [StartDateTime], [EndDateTime])

    To display this value as hours and minutes, I'm using a text box with this Control Source:
    =[Minutes] \ 60 & Format([Minutes] Mod 60, "\:00")

    Any help would be much appreciated, thanks!

    - Linton

  2. #2
    Forum Contributor
    Join Date
    04-16-2009
    Location
    Dorset, UK
    MS-Off Ver
    Office 2003, Office 2007
    Posts
    131

    Re: form not recognizing variable defined in query

    You're using the wrong slash for dividing, so for starters try:

    =[Minutes] / 60 & Format([Minutes] Mod 60, "\:00")

    ...then let us know if you're still having problems.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1