Page 3 of 3 FirstFirst 123
Results 31 to 33 of 33
  1. #31
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    1. Why do you have the words "Final Cut" & "First Cut" in that field?

    2. I was thinking of the function looking something like this:

    Code:
     
    Function Get_Cut_Number(CutNumber As String) As String
    'CutNumber as String is the value of Cut_No from your Table passed in from the query.
    '"As String" at the end of the Function Name is saying that what is going to be Returned is a String.
     
    Dim Result as String
     
    If CutNumber = "Final Cut" Then
       Result = 11
    Else If CutNumber = "First Cut" Then
       Result = 1
    Else
       Result = CutNumber
    End If
     
    Get_Cut_Number = Result
     
    End Function
    In your Query, you'll have a field that looks something like this:
    Cut_Number: Max(CInt(Get_Cut_Number([Cut_No])))
    and in your Criteria you'll have > 10.



    What that will do is for each row of data, it will send the Cut_No value to the function and then put in whatever the function returns.

    You'll have to decide what you want to do with 'First Cut' and 'Last Cut' in the function.
    The query still won't work if you have those words as values instead of numbers.

    I haven't tested the above Code so there could be typos etc - but I have used this type of processing several times when I've needed specific things done to Table data in a query.

    Let me know how it goes!!
    Last edited by Robeen; 12-15-2011 at 11:26 AM. Reason: Ommission.

  2. #32
    mejia.j88 is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Nov 2011
    Location
    california
    Posts
    228
    1. i just started working at this company and one of my projects is to eliminate all paperwork into electronic documentation, they are very iffy when it comes to changing things (as little as it may seem here, with final cut=11), i'd rather keep things as close as possible to how they are/were.

    2. i'll play around with this a tiny bit if it doenst work, i'll let you konw when i get it working.

    thanks so much for your help Robeen,
    you deserve xmas cookies and treats for your kindness.

  3. #33
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    I understand about them not wanting anything changed.

    The code I gave you should at least give you an idea of one possible way to get what you need.

    I hope you're able to figure it out.

    Let me know if you are able to get it going or if you have problems.

    All the best!

Page 3 of 3 FirstFirst 123
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Starting a new database
    By JFo in forum Access
    Replies: 9
    Last Post: 08-25-2011, 11:00 PM
  2. Replies: 7
    Last Post: 05-21-2010, 10:37 PM
  3. Replies: 9
    Last Post: 04-28-2009, 05:42 PM
  4. VB code in Access '07 trouble
    By Pauldk in forum Reports
    Replies: 2
    Last Post: 02-18-2009, 03:59 PM
  5. Code Trouble?
    By briancb2004 in forum Access
    Replies: 0
    Last Post: 10-08-2008, 04:47 PM

Tags for this Thread

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