0

I have a text box that populates when searching for a members information. The text box populates with a claim # in the format of: A999999999999001 where the 9's could be any # but the letter A and the 001 will always be consistant.

In excel you can use the formula =mid(cell reference, starting character, # of characters) to extract the middle portion of the text..

is there a way to do this in Access? I want to create a "COPY" button that will allow users to copy just the 9's from the claim # to the clipboard and drop the A and 001's.

The claim # must maintain its full format in the tables, however the reduced portion is used in another program to pull up specific information about a transaction.

Any help would be greatly appreciated.

Erik A
  • 31,639
  • 12
  • 42
  • 67
Checht
  • 45
  • 10
  • https://www.techonthenet.com/access/functions/string/mid.php – PM 77-1 Apr 20 '18 at 21:35
  • 1
    Try the code and post your problems here. Use MID function - should be obvious to at least try the same VBA function in Access. – dbmitch Apr 21 '18 at 19:00
  • I am still unsure how to copy (if possible) directly to the clipboard from the text box.. Based on the techonthenet article posted (Thank you for that.. I did try to search Stack before posting my question.. hadn't found any definitive answers) I was able to complete the task by creating a 2nd text box that fills and then is copied from with the button press.. Code is this: 'Dim CopyArgusNum1 As String CopyArgusNum1 = Mid(Me.txtArgusClaim1.Value, 2, 12) Me.txtCopyArgusClaim1.Value = CopyArgusNum1 Me.txtCopyArgusClaim1.SetFocus DoCmd.RunCommand acCmdCopy' – Checht Apr 23 '18 at 15:47

1 Answers1

0

I am still unsure how to copy (if possible) directly to the clipboard from the text box.. Based on the techonthenet article posted (Thank you for that.. I did try to search Stack before posting my question.. hadn't found any definitive answers) I was able to complete the task by creating a 2nd text box that fills and then is copied from with the button press.. Code is this:

'Dim CopyArgusNum1 As String CopyArgusNum1 = Mid(Me.txtArgusClaim1.Value, 2,12) 
Me.txtCopyArgusClaim1.Value = CopyArgusNum1 
Me.txtCopyArgusClaim1.SetFocus 
DoCmd.RunCommand acCmdCopy'
Checht
  • 45
  • 10