Automated Paste in Windows 7 & 10 (1 Viewer)

Learn2010

Registered User.
Local time
Today, 16:02
Joined
Sep 15, 2010
Messages
415
I have a program where the user clicks a button on the Customer screen that will send a record to another database in another folder on a shared drive. It also opens a dialogue box that asks them if they want to copy relevant records over to that folder.

When the button is clicked, it copies the CustID.
Dialogue box opens.
If yes is selected, the folder where the files are stored opens.
The user pastes the CustID in the search box at the top.
All files with that CustID are displayed.
The user right clicks on the files they want to copy over.
User selects Send To and picks the destination folder.

Is there a way to have the CustID automatically paste into the Search box?

Here is the code I use.

START OF CODE

Dim LFResponse As Integer
LFResponse = MsgBox("Do you want to open the Linked files folder? If yes," & vbCrLf & vbCrLf & _
"1 - Remember to paste the CustID into the Search Box by right clicking on it" & vbCrLf & _
"2 - Choose paste, and" & vbCrLf & _
"3 - Right click on the files that show up" & vbCrLf & _
"4 - Left click on Send To" & vbCrLf & _
"5 - Choose LinkFiles", vbYesNo, "Continue")
If LFResponse = vbYes Then
Dim Foldername As String
Foldername = "\\Folder1\Folder2\Folder3\Folder4\Folder5\Folder6\"
Shell "C:\WINDOWS\explorer.exe """ & Foldername & "", vbNormalFocus
Else
Cancel = True
End If

END OF CODE
 

Gasman

Enthusiastic Amateur
Local time
Today, 20:02
Joined
Sep 21, 2011
Messages
14,047
This is how I did it when I had to have that functionality.
The code would take the case reference last used and place it in the new DB ready for the rest of the form to be completed.

HTH
Code:
Private Sub cmdCaseFlow_Click()
' This code supplied by Ashley Baker instead of using clipboard
Const dbPath As String = "C:\Program Files\PPI Caseflow\PPI Caseflow.mde"

On Error GoTo Err_Handler
    
    Dim appAccess As Access.Application
    
    Set appAccess = GetObject(dbPath)
    
    ' appAccess.Visible = True
    
    appAccess.DoCmd.OpenForm "frm_Caseflow"
    
    appAccess.Forms!frm_Caseflow!ub_Charter = Me.txtPrev_Ref
    appAccess.Forms.frm_Caseflow!chk_RememberSelection = True
    
    appAccess.Forms!frm_Caseflow.Refresh
    
    appAccess.DoCmd.RunCommand acCmdAppMinimize
    
    appAccess.DoCmd.RunCommand acCmdAppMaximize

Exit_Handler:
    Exit Sub
 

Learn2010

Registered User.
Local time
Today, 16:02
Joined
Sep 15, 2010
Messages
415
The new DB will be used at another place and time and the last record may not be the one used. I just need to be able to paste that CustID in the Search box at this time.

Thank you.
 

Gasman

Enthusiastic Amateur
Local time
Today, 20:02
Joined
Sep 21, 2011
Messages
14,047
I just mentioned that to explain the code.
You just use the same concept, so where I have Me.txtPrev_Ref you would use CustID. You need to match it to whatever the control is called on the destination form. Mine was called ub_Charter

The new DB will be used at another place and time and the last record may not be the one used. I just need to be able to paste that CustID in the Search box at this time.

Thank you.
 

Learn2010

Registered User.
Local time
Today, 16:02
Joined
Sep 15, 2010
Messages
415
Let me clarify what I need. The user will send these records over to the other DB to be used later that day or sometime on the succeeding days. I am not trying to transfer the CustID. I am using it to isolate the corresponding files.

When the record(s) is transferred, the Windows Explorer folder opens to a specific folder. Within that folder are the needed files, of which the files in that folder could number in the thousands. So, to isolate the needed files. they place the cursor in the Search box at the top of the page, right click, and hit Paste. This then will only display files that have that CustID.

The user then chooses the specific ones they need, right click on them and use the SendTo option to send them to another folder.

What I need at this time is a way to have only the files with that CustID already displayed so that the user does not have to paste the CustID in the Search box.
 

Gasman

Enthusiastic Amateur
Local time
Today, 20:02
Joined
Sep 21, 2011
Messages
14,047
So run the code that runs after they have pasted the CustID at the moment.?
Put the CustID in the control and run the event that filters the files.

Sorry, I am having some difficulty here understanding what is so difficult.?
You are just trying to automate what they would do normally.

In that form of mine, I completed two controls with the information I had from my DB into another form in another DB, the user completed another two controls and then saved the record. If I had that other information, I could have done it for them, saved the record, closed the form and brought them back to my database.

That code was written when I knew even less than I know now. I was giving the control names by the named person in the code and instructed what to set and use.

I am not an expert in Access as you can see from my signature, but I am at a loss as to what I could be missing here.?:banghead:

I am going bow out and hope an expert steps in to assist you.
 

Users who are viewing this thread

Top Bottom