Return a Character String-position through a function

  • Thread starter Thread starter J. Darrington
  • Start date Start date
J

J. Darrington

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.
 
Thank you so much. This worked perfectly.

Jeremy
-----Original Message-----
Hi,
Look at InStr in Help.

--
HTH
Dan Artuso, Access MVP


"J. Darrington" <[email protected]> wrote in
message news:[email protected]...
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.


.
 
Back
Top