473,387 Members | 1,859 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Drag and Drop

Hi everyone,

Has anyone got any experience with drop and drag in Access?

I would like to make a calendar style form where my users can drop and drag
appointments....

I am using Access 2003 and I have access to .net and the like, but I would
really like to keep it simple.

Thank you

Nicolaas
---
Please immediately let us know (by phone or return email) if (a) this email
contains a virus
(b) you are not the intended recipient
(c) you consider this email to be spam.
We have done our utmost to make sure that
none of the above are applicable. THANK YOU
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.679 / Virus Database: 441 - Release Date: 07/05/2004
Nov 12 '05 #1
8 20796
There's no specific support for drag-and-drop in any version of Access
through 2003. Some have simulated it, with varying degrees of success --
none, as far as I know, nearly as smooth and seamless as drag-and-drop in
languages which support it (or use of the APIs that support it).

Larry Linson
Microsoft Access MVP

"WindAndWaves" <ac****@ngaru.com> wrote in message
news:3n******************@news.xtra.co.nz...
Hi everyone,

Has anyone got any experience with drop and drag in Access?

I would like to make a calendar style form where my users can drop and drag appointments....

I am using Access 2003 and I have access to .net and the like, but I would
really like to keep it simple.

Thank you

Nicolaas
---
Please immediately let us know (by phone or return email) if (a) this email contains a virus
(b) you are not the intended recipient
(c) you consider this email to be spam.
We have done our utmost to make sure that
none of the above are applicable. THANK YOU
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.679 / Virus Database: 441 - Release Date: 07/05/2004

Nov 12 '05 #2
thank you for that answer,

does anyone then perhaps know if you can 'link' into a specific program to
use drop and drag or perhaps that you can link with outlook to drop the data
into the outlook calender????

or who did it with success in access????

I noticed that in the mouseUp, mousedown event, etc... there is information
on the location of the mouse....

You should be able to write a general function that manages these 'pick-ups'
and 'drop-offs'....

keen to hear any further thoughts on this.

Thank you all for your help.

"Larry Linson" <bo*****@localhost.not> wrote in message
news:_H******************@nwrddc02.gnilink.net...
There's no specific support for drag-and-drop in any version of Access
through 2003. Some have simulated it, with varying degrees of success --
none, as far as I know, nearly as smooth and seamless as drag-and-drop in
languages which support it (or use of the APIs that support it).

Larry Linson
Microsoft Access MVP

"WindAndWaves" <ac****@ngaru.com> wrote in message
news:3n******************@news.xtra.co.nz...
Hi everyone,

Has anyone got any experience with drop and drag in Access?

I would like to make a calendar style form where my users can drop and

drag
appointments....

I am using Access 2003 and I have access to .net and the like, but I would really like to keep it simple.

Thank you

Nicolaas
---
Please immediately let us know (by phone or return email) if (a) this

email
contains a virus
(b) you are not the intended recipient
(c) you consider this email to be spam.
We have done our utmost to make sure that
none of the above are applicable. THANK YOU
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.679 / Virus Database: 441 - Release Date: 07/05/2004


---
Please immediately let us know (by phone or return email) if (a) this email
contains a virus
(b) you are not the intended recipient
(c) you consider this email to be spam.
We have done our utmost to make sure that
none of the above are applicable. THANK YOU
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.679 / Virus Database: 441 - Release Date: 07/05/2004
Nov 12 '05 #3
Hi
There is a sample at this link
http://www.databaseadvisors.com/down...ragAndDrop.zip

--
____________________________

Sigurd Bruteig
www.made4u.no

"WindAndWaves" <ac****@ngaru.com> skrev i melding
news:3n******************@news.xtra.co.nz...
Hi everyone,

Has anyone got any experience with drop and drag in Access?

I would like to make a calendar style form where my users can drop and drag appointments....

I am using Access 2003 and I have access to .net and the like, but I would
really like to keep it simple.

Thank you

Nicolaas
---
Please immediately let us know (by phone or return email) if (a) this email contains a virus
(b) you are not the intended recipient
(c) you consider this email to be spam.
We have done our utmost to make sure that
none of the above are applicable. THANK YOU
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.679 / Virus Database: 441 - Release Date: 07/05/2004

Nov 12 '05 #4
On Sun, 9 May 2004 15:30:13 +1200, "WindAndWaves" <ac****@ngaru.com>
wrote:

You would think that MouseUp etc. is all you need, but that is far
from the truth. If the tool lacks the basic support, it is exceedingly
difficult to build it yourself.

I would say this is one good reason to go with VB or .NET

-Tom.
thank you for that answer,

does anyone then perhaps know if you can 'link' into a specific program to
use drop and drag or perhaps that you can link with outlook to drop the data
into the outlook calender????

or who did it with success in access????

I noticed that in the mouseUp, mousedown event, etc... there is information
on the location of the mouse....

You should be able to write a general function that manages these 'pick-ups'
and 'drop-offs'....

keen to hear any further thoughts on this.

Thank you all for your help.

"Larry Linson" <bo*****@localhost.not> wrote in message
news:_H******************@nwrddc02.gnilink.net. ..
There's no specific support for drag-and-drop in any version of Access
through 2003. Some have simulated it, with varying degrees of success --
none, as far as I know, nearly as smooth and seamless as drag-and-drop in
languages which support it (or use of the APIs that support it).

Larry Linson
Microsoft Access MVP

"WindAndWaves" <ac****@ngaru.com> wrote in message
news:3n******************@news.xtra.co.nz...
> Hi everyone,
>
> Has anyone got any experience with drop and drag in Access?
>
> I would like to make a calendar style form where my users can drop and

drag
> appointments....
>
> I am using Access 2003 and I have access to .net and the like, but Iwould > really like to keep it simple.
>
> Thank you
>
> Nicolaas
>
>
> ---
> Please immediately let us know (by phone or return email) if (a) this

email
> contains a virus
> (b) you are not the intended recipient
> (c) you consider this email to be spam.
> We have done our utmost to make sure that
> none of the above are applicable. THANK YOU
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.679 / Virus Database: 441 - Release Date: 07/05/2004
>
>


---
Please immediately let us know (by phone or return email) if (a) this email
contains a virus
(b) you are not the intended recipient
(c) you consider this email to be spam.
We have done our utmost to make sure that
none of the above are applicable. THANK YOU
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.679 / Virus Database: 441 - Release Date: 07/05/2004


Nov 12 '05 #5
Hi Tom (goedemorege)

I have a huge database in Access, can I take that into VB??? / .net and if
so how do I go about it????
---
Please immediately let us know (by phone or return email) if (a) this email
contains a virus
(b) you are not the intended recipient
(c) you consider this email to be spam.
We have done our utmost to make sure that
none of the above are applicable. THANK YOU
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.679 / Virus Database: 441 - Release Date: 07/05/2004
Nov 12 '05 #6
The database part can be used pretty much intact, but the user interface
will be almost a total rewrite, no matter whether you use classic VB or
VB.NET. Despite the visual resemblance between forms / screens in classic VB
and Access, the object model is different. There are/were some third-party
products that were designed to assist in an Access-to-VB conversion.

But, is it or will it be worth the time and effort just to get drag and
drop? I've been developing general business applications with Access (single
user, multiuser, and client-server) and never felt severly penalized due to
lack of drag-and-drop. There has always been some other approach that
accomplished the purpose and could be done just using native Access
features.

That is, I've never had a client say, "I want it to do 'X', _and_ I want it
to do it with drag-and-drop."

Larry Linson
Microsoft Access MVP
"WindAndWaves" <ac****@ngaru.com> wrote in message
news:1W*******************@news.xtra.co.nz...
Hi Tom (goedemorege)

I have a huge database in Access, can I take that into VB??? / .net and if
so how do I go about it????
---
Please immediately let us know (by phone or return email) if (a) this email contains a virus
(b) you are not the intended recipient
(c) you consider this email to be spam.
We have done our utmost to make sure that
none of the above are applicable. THANK YOU
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.679 / Virus Database: 441 - Release Date: 07/05/2004

Nov 12 '05 #7
Here is a post from Felix Lima, a MS Suport Engineer, on Drag and Drop
in Access.

In order to do this effectively in Access, you will need to use
subclassing
and API calls. Subclassing in Access is not really recommended and may
cause significant problems. Q278379 explains some problems with
subclassing:

"Because of problems with subclassing windows after loading the
Microsoft Office Visual Basic Editor,
Microsoft highly recommends that you use Microsoft Visual Basic or
Microsoft Visual C++ to
create an ActiveX DLL, and that you then reference the DLL from your
Microsoft Access
application."

Basically, In order to successfully get this to work, you need to
subclass the window and then call the DragAcceptFiles() API. When the
user drops
files from explorer, the window is sent the WM_DROPFILES message. This
can be accomplished in Access by first creating a VB dll and then
calling
the dll from Access.

I was able to create a VB 6 dll which can be referenced in Access to
successfully get the file path from windows explorer to a textbox on an
access form. (It is a modification of a post by Stoil Marinov in
comp.lang.basic.visual 19/11/1999):

Here are the steps I took:

a) Create a VB6 dll with a module (basDragDrop) and a class
(clsDragDrop)

b) Add the following code to the basDragDrop module:

Option Compare Text
Option Explicit

Public CDrag As CDragDrop
Public lpPrevWndProc As Long
Public Const GWL_WNDPROC = (-4)
Public Const WM_DROPFILES = &H233
Public Const GetNumOfFiles = &HFFFF
Public Declare Function CallWindowProc Lib "user32" Alias _
"CallWindowProcA" (ByVal lpPrevWndFunc As Long, _
ByVal hWnd As Long, _
ByVal Msg As Long, _
ByVal wParam As Long, _
ByVal lParam As Long) As Long

Public Declare Function SetWindowLong Lib "user32" Alias _
"SetWindowLongA" (ByVal hWnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long

Public Declare Sub DragAcceptFiles Lib "shell32.dll" _
(ByVal hWnd As Long, _
ByVal fAccept As Long)

Public Declare Sub DragFinish Lib "shell32.dll" _
(ByVal hDrop As Long)

Public Declare Function DragQueryFile Lib "shell32.dll" _
Alias "DragQueryFileA" (ByVal hDrop As Long, _
ByVal lFile As Long, _
ByVal lpFileName As String, _
ByVal cbLen As Long) As Long

Public Function WindowProc(ByVal hWnd As Long, ByVal Msg As Long, ByVal
wp
As Long, ByVal lp As Long) As Long
If Msg = WM_DROPFILES Then
'Files have been dropped
CDrag.AcceptDroppedFiles wp
Else
WindowProc = CallWindowProc(lpPrevWndProc, hWnd, Msg, wp, lp)
End If
End Function

c) Add the following code CDragDrop:

Option Compare Text
Option Explicit
Private frm As Object
Private txt As Object

Public Property Set Form(frmIn As Object)
Set frm = frmIn
End Property

Public Property Set textbox(txtin As Object)
Set txt = txtin
End Property

Public Sub SubClassHookForm()

Call DragAcceptFiles(frm.hWnd, 1)

lpPrevWndProc = SetWindowLong(frm.hWnd, GWL_WNDPROC, _
AddressOf WindowProc)

Set CDrag = Me

End Sub

Public Sub SubClassUnHookForm()

Call SetWindowLong(frm.hWnd, GWL_WNDPROC, lpPrevWndProc)

Call DragAcceptFiles(frm.hWnd, 0)

End Sub
Sub AcceptDroppedFiles(hDrop As Long)

Dim lNumOfFiles As Long

Dim lReturn As Long

Dim sFilename As String

Dim lm As Long

'Get the number of dropped files
lNumOfFiles = DragQueryFile(hDrop, GetNumOfFiles, 0&, 0)

For lm = 0 To lNumOfFiles
'Allocate buffer for the name of the file

sFilename = String$(257, Chr$(0))
'Get the name of the file

lReturn = DragQueryFile(hDrop, lm, sFilename, Len(sFilename))

'Add the file name to the list

If lReturn > 0 Then

txt.Text = txt.Text & Left$(sFilename, lReturn) & vbCrLf

End If

Next lm
'Tell Windows to free the memory allocated to store the dropped files
DragFinish hDrop
End Sub

c) Compile the dll in VB

d) Add the following to a form in Access that has a textbox called
Text1
and a reference to the compiled dll above:

Option Compare Database
Option Explicit

Dim CDrag As New CDragDrop

Private Sub Form_Load()

'Subclass the form
Set CDrag.TextBox = Me.Text1
Set CDrag.Form = Me
CDrag.SubClassHookForm

End Sub

Private Sub Form_Unload(Cancel As Integer)
'UnSubclass the form

CDrag.SubClassUnHookForm
Set CDrag.Form = Nothing
Set CDrag.TextBox = Nothing
Set CDrag = Nothing

End Sub
HTH

Félix Lima
Microsoft Online Support Engineer

This posting is provided "AS IS" with no warranties, and confers no
rights.
Get Secure! - www.microsoft.com/security

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"WindAndWaves" <ac****@ngaru.com> wrote in message
news:3n******************@news.xtra.co.nz...
Hi everyone,

Has anyone got any experience with drop and drag in Access?

I would like to make a calendar style form where my users can drop and drag appointments....

I am using Access 2003 and I have access to .net and the like, but I would really like to keep it simple.

Thank you

Nicolaas
---
Please immediately let us know (by phone or return email) if (a) this email contains a virus
(b) you are not the intended recipient
(c) you consider this email to be spam.
We have done our utmost to make sure that
none of the above are applicable. THANK YOU
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.679 / Virus Database: 441 - Release Date: 07/05/2004


Nov 12 '05 #8
Access has nothing built-in to allow drag and drop between controls.
There are some third-party tools that might help:

A shareware version of Drag-N-Dropper for MS Access is available at
this web site: http://www.peterssoftware.com/dd.htm

Stephen Lebans has an example of a FieldList control that supports
drag and drop: http://www.lebans.com/vb_listbox.htm

The Forms Sample database provided by Microsoft has an example called
"Simulating Drag-And-Drop Capabilities". You can download the sample
database here: http://support.microsoft.com/default...b;EN-US;175066

Hope this helps,

--
Peter De Baets
Peter's Software - MS Access Tools for Developers
http://www.peterssoftware.com
Nov 12 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: hemant_mishal | last post by:
Hi All, I am writting a java script library which will provide inter frame drag and drop operation. The more precise will be OLE drag and drop, which means only data will be transfered from frame...
0
by: Lauren Quantrell | last post by:
I'm trying to drop a file from Windows Explorer (or desktop, etc.) onto a field in Access2K and capture the full file path. I found an posting below that says this is possible but I cannot...
2
by: SamSpade | last post by:
There seems to be two ways to put things on the clipboard ( I don't mean different formats): SetClipboardData and OleSetClipboard If I want to get data off the clipboard do I care how it was put...
3
by: Ajay Krishnan Thampi | last post by:
I have a slight problem implementing 'drag and drop' from a datagrid to a tree-view. I have pasted my code below. Someone please advice me on what to do...pretty blur right now. ==code== ...
6
by: jojobar | last post by:
Hello, I look at the asp.net 2.0 web parts tutorial on the asp.net web site. I tried to run it under firefox browser but it did not run. If I want to use this feature in a commercial product...
3
by: VB Programmer | last post by:
In VB.NET 2005 (winform) any sample code to drag & drop items between 2 listboxes? Thanks!
0
by: ViRi | last post by:
I am currently experimenting a bit with AxMicrosoft.MediaPlayer.Intero­p.AxWindowsMediaPlayer and so far, most has gone well. Currently, i would like to add drag-and-drop functionality to the...
1
by: Darren | last post by:
I'm trying to create a file using drag and drop. I want to be able to select a listview item drag it to the shell and create a file. Each icon in the listview represents a blob in a database. When...
0
by: RHSFSS | last post by:
Hi, I have a Drag and Drop registration problem (See http://www.thescripts.com/forum/thread434707.html for similar problem post), can anyone out thereadvise on the best solution? I have a .NET 2.0 ...
5
by: Romulo NF | last post by:
Greetings, I´m back here to show the new version of the drag & drop table columns (original script ). I´ve found some issues with the old script, specially when trying to use 2 tables with...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.