Results 1 to 11 of 11
  1. #1
    wcook101 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jan 2020
    Posts
    56

    Why cant I drag and drop selected text from a note field into a text box?

    I have a note field where we dump a lot of info scraped off the web, and then we fill in certain fields like address, city, state...etc. Presently all we can do is highlight the text we want and paste it. Its really slow when we could be selecting and dragging. Why is this function not working in Access?

  2. #2
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,511
    Can you give an example of the steps you want to do? So you highlight data from a web page and past it into the Access form and you want to be able to drag data from a webpage to an Access form? Or do you mean inside of Access, you want to drag one field to another field on a form?

  3. #3
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,845
    where else does it work? For access you will need to create a function. Drag and drop functions exist, but they generally work on the whole text rather than highlighted text.

    you can identify highlighted text using the selstart and sellength properties of a control. Here is a link to one example for dragging and dropping

    https://www.access-programmers.co.uk...-boxes.205498/

  4. #4
    wcook101 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jan 2020
    Posts
    56
    We highlight data (address, city street phone etc..) from a web page, copy it to clipboard, then paste it into a note field in access. Then we populate the address, city, state fields by cut and paste via mouse. What we would like to do is highlight certain pieces of the text in the notes field like the address and highlight and drag it over to the address field and drop it and move on to the next piece of info. but as it stands now i can highlight what I want in the note field but when I left click it to drag it, nothing happens and in fact it looses focus.
    Why is that?

  5. #5
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,845
    see this example db - not drag and drop but click and drop with simple code
    Attached Files Attached Files

  6. #6
    wcook101 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jan 2020
    Posts
    56
    Ajax,
    that's pretty cool. Nice work around,
    One thing I cant figure out is where is the function dropName stored. Its obviously a function, but I cant call it up anywhere. The only place I see it is when I bring up the code for it. Then I find it listed in the general declarations. Im confused. Shouldnt it be available as a custom function?
    Im going to use the code if thats ok.. But just for kicks, does anyone know why access doesn't have a drag and drop function from text to text?
    Last edited by wcook101; 03-16-2020 at 08:35 PM.

  7. #7
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,845
    no idea why not - and I haven't seen it as a standard feature anywhere except on web pages.

    good luck

  8. #8
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Quote Originally Posted by wcook101 View Post

    ...does anyone know why access doesn't have a drag and drop function from text to text?
    Because it's not a word processing program?

    Linq ;0)>

  9. #9
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,845
    One thing I cant figure out is where is the function dropName stored. Its obviously a function, but I cant call it up anywhere. The only place I see it is when I bring up the code for it. Then I find it listed in the general declarations. Im confused. Shouldnt it be available as a custom function?
    Sorry missed this

    the function is a public function (the default if private not declared) and is in the form code module - it could go in a general module, but since it refers to Text6 in the form, would require more work and only beneficial if going to be used in more than one form. If the form was closed, then the function would not be available, but since the form has to be open to call it.......

    With regards calling, you will find that on the property sheet events tab, where your would normally expect to see [Event Procedure].

    The benefit of doing it this way is a) less code and b) you can select multiple controls and populate the property once.

    Aside from above, calling functions this way has other benefits. If the function (or functions) are in a general module, they can be called from anywhere without having to have a form module. Not having a form module means the form will load faster. There are limitations - if your code needs to know things like the position of the cursor over a control, you would use one of the mouse events which returns the XY coordinates as the sub parameters. calling a function can't do that (at least I've never found a way without needing a fair amount of code). You can pass the form as a parameter (equivalent of Me in vba) using [FORM] i.e. =somefunction([Form]) or a control name if you wish =somefunction([myControlName]) or other parameters as required

  10. #10
    wcook101 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jan 2020
    Posts
    56
    Quote Originally Posted by Missinglinq View Post
    Because it's not a word processing program?
    Its not? What is it processing?

  11. #11
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Let's see...it's a database program...now what could it be processing?

    Linq ;0)>

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 09-19-2017, 09:49 AM
  2. Replies: 2
    Last Post: 07-10-2017, 12:30 AM
  3. Replies: 1
    Last Post: 09-11-2013, 01:22 PM
  4. Drag text from Forms
    By imran688 in forum Forms
    Replies: 2
    Last Post: 10-31-2012, 01:33 PM
  5. API: Drag and Drop from Explorer to a text box
    By ybg1 in forum Programming
    Replies: 1
    Last Post: 01-02-2012, 02:23 PM

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