Professional Web Applications Themes

Return a Character String-position through a function - Microsoft Access

Thanks in advance for your help! (MS Access 2000 Professional) I have the following function: Public Function EnterMfgPartNum(Placeholder As String) As String Dim TransferValue As String Dim MLocationPosition as Integer Placeholder = Forms!Products!ProductName MLocationPosition = [I NEED HELP HERE] TransferValue = Mid(Placeholder, "M", 10) Debug.Print TransferValue If IsNull(Forms!Products!MfgPartNumber) Then Debug.Print TransferValue Forms!Products!MfgPartNumber = UCase$(TransferValue) Forms!Products!VendorPartNum = UCase$(TransferValue) Forms!Products!SupplierID = "000589" Forms!Products!LeadTime = "40" Forms!Products!ReorderLevel = 6 Forms!Products!MfgID = "SMEAD" Forms!Products!CategoryID = "999" Forms!Products!UnitPrice = "$85.30" End If End Function The place in the code where it says "[I NEED HELP HERE]" is the character position in a string of a ...

  1. #1

    Default Return a Character String-position through a function

    Thanks in advance for your help!

    (MS Access 2000 Professional)

    I have the following function:

    Public Function EnterMfgPartNum(Placeholder As String) As
    String

    Dim TransferValue As String
    Dim MLocationPosition as Integer

    Placeholder = Forms!Products!ProductName
    MLocationPosition = [I NEED HELP HERE]
    TransferValue = Mid(Placeholder, "M", 10)
    Debug.Print TransferValue
    If IsNull(Forms!Products!MfgPartNumber) Then
    Debug.Print TransferValue
    Forms!Products!MfgPartNumber =
    UCase$(TransferValue)
    Forms!Products!VendorPartNum =
    UCase$(TransferValue)
    Forms!Products!SupplierID = "000589"
    Forms!Products!LeadTime = "40"
    Forms!Products!ReorderLevel = 6
    Forms!Products!MfgID = "SMEAD"
    Forms!Products!CategoryID = "999"
    Forms!Products!UnitPrice = "$85.30"
    End If

    End Function

    The place in the code where it says "[I NEED HELP HERE]"
    is the character position in a string of a Certain Value
    ("M") that I need to start counting from. I am trying to
    extract a part number from a string classification where
    the string starts M and ends at the end of the field..

    I know of a Spreadsheet function (SEARCH
    (find_text,within_text,start_num) that will do this but
    have not been able to find it in Access.

    Can someone Direct me to the proper function or code.
    Thanks.

    Jeremy Darrington
    Smead Mfg. Co.
    J. Darrington Guest

  2. #2

    Default Re: Return a Character String-position through a function

    Hi,
    Look at InStr in Help.

    --
    HTH
    Dan Artuso, Access MVP


    "J. Darrington" <jeremy.darringtonsmead.com> wrote in message news:0a5001c34c66$0a8b1c90$a401280aphx.gbl...
    > Thanks in advance for your help!
    >
    > (MS Access 2000 Professional)
    >
    > I have the following function:
    >
    > Public Function EnterMfgPartNum(Placeholder As String) As
    > String
    >
    > Dim TransferValue As String
    > Dim MLocationPosition as Integer
    >
    > Placeholder = Forms!Products!ProductName
    > MLocationPosition = [I NEED HELP HERE]
    > TransferValue = Mid(Placeholder, "M", 10)
    > Debug.Print TransferValue
    > If IsNull(Forms!Products!MfgPartNumber) Then
    > Debug.Print TransferValue
    > Forms!Products!MfgPartNumber =
    > UCase$(TransferValue)
    > Forms!Products!VendorPartNum =
    > UCase$(TransferValue)
    > Forms!Products!SupplierID = "000589"
    > Forms!Products!LeadTime = "40"
    > Forms!Products!ReorderLevel = 6
    > Forms!Products!MfgID = "SMEAD"
    > Forms!Products!CategoryID = "999"
    > Forms!Products!UnitPrice = "$85.30"
    > End If
    >
    > End Function
    >
    > The place in the code where it says "[I NEED HELP HERE]"
    > is the character position in a string of a Certain Value
    > ("M") that I need to start counting from. I am trying to
    > extract a part number from a string classification where
    > the string starts M and ends at the end of the field..
    >
    > I know of a Spreadsheet function (SEARCH
    > (find_text,within_text,start_num) that will do this but
    > have not been able to find it in Access.
    >
    > Can someone Direct me to the proper function or code.
    > Thanks.
    >
    > Jeremy Darrington
    > Smead Mfg. Co.

    Dan Artuso Guest

  3. #3

    Default Re: Return a Character String-position through a function

    Thank you so much. This worked perfectly.

    Jeremy
    >-----Original Message-----
    >Hi,
    >Look at InStr in Help.
    >
    >--
    >HTH
    >Dan Artuso, Access MVP
    >
    >
    >"J. Darrington" <jeremy.darringtonsmead.com> wrote in
    message news:0a5001c34c66$0a8b1c90$a401280aphx.gbl...
    >> Thanks in advance for your help!
    >>
    >> (MS Access 2000 Professional)
    >>
    >> I have the following function:
    >>
    >> Public Function EnterMfgPartNum(Placeholder As String)
    As
    >> String
    >>
    >> Dim TransferValue As String
    >> Dim MLocationPosition as Integer
    >>
    >> Placeholder = Forms!Products!ProductName
    >> MLocationPosition = [I NEED HELP HERE]
    >> TransferValue = Mid(Placeholder, "M", 10)
    >> Debug.Print TransferValue
    >> If IsNull(Forms!Products!MfgPartNumber) Then
    >> Debug.Print TransferValue
    >> Forms!Products!MfgPartNumber =
    >> UCase$(TransferValue)
    >> Forms!Products!VendorPartNum =
    >> UCase$(TransferValue)
    >> Forms!Products!SupplierID = "000589"
    >> Forms!Products!LeadTime = "40"
    >> Forms!Products!ReorderLevel = 6
    >> Forms!Products!MfgID = "SMEAD"
    >> Forms!Products!CategoryID = "999"
    >> Forms!Products!UnitPrice = "$85.30"
    >> End If
    >>
    >> End Function
    >>
    >> The place in the code where it says "[I NEED HELP HERE]"
    >> is the character position in a string of a Certain Value
    >> ("M") that I need to start counting from. I am trying to
    >> extract a part number from a string classification where
    >> the string starts M and ends at the end of the field..
    >>
    >> I know of a Spreadsheet function (SEARCH
    >> (find_text,within_text,start_num) that will do this but
    >> have not been able to find it in Access.
    >>
    >> Can someone Direct me to the proper function or code.
    >> Thanks.
    >>
    >> Jeremy Darrington
    >> Smead Mfg. Co.
    >
    >
    >.
    >
    J. Darrington Guest

Similar Threads

  1. Web Services return string: An XML string
    By DotNetGruven in forum ASP.NET Web Services
    Replies: 3
    Last Post: June 30th, 06:48 PM
  2. Position of Character
    By Andre Hessler in forum Macromedia Flash Actionscript
    Replies: 2
    Last Post: January 20th, 11:25 AM
  3. Replies: 4
    Last Post: September 12th, 04:19 PM
  4. RETURN character
    By Treylok in forum Macromedia Director Lingo
    Replies: 4
    Last Post: August 28th, 03:29 PM
  5. Function to find position of the last numeric character inconsistent
    By Adrian in forum Microsoft SQL / MS SQL Server
    Replies: 3
    Last Post: July 4th, 01:44 PM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139