dbTalk Databases Forums  

Form-Multiple record selection/manipulation

comp.databases.ms-access comp.databases.ms-access


Discuss Form-Multiple record selection/manipulation in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
JohnP
 
Posts: n/a

Default Form-Multiple record selection/manipulation - 01-25-2011 , 07:24 AM






This must be a challenge! In its simplest format assume a form that
shows the available appointments for a specific day. Assume two bound
fields (date, name), and for the specific day 10 available records at
30 minute intervals, say beginning at 09:00, 09:30, 10:00 ... ending
at 13:30.

Sometimes I need to assign more than one 30 minute appointment to the
same person. Taking a specific example I would like to assign 10:00,
10:30 and 11:00 to the same person.

Once I enter the name in the 10:00 slot, I would ideally like to click
on the record selector to the left of the 10:00 slot and drag the
cursor to the 11:00 record selector and have the name replicated in
all 3 time slots.

I tried using MouseDown. This can identify the name value in the 10:00
slot. I dragged the cursor and hoped that MouseUp would identify the
value in the 11:00 slot. It did not. It identified the value in the
10:00 slot.

Any ideas on how to perform this multiple record selection and
manipulation?
Thanks,
John

Reply With Quote
  #2  
Old   
Marshall Barton
 
Posts: n/a

Default Re: Form-Multiple record selection/manipulation - 01-25-2011 , 02:03 PM






JohnP wrote:

Quote:
This must be a challenge! In its simplest format assume a form that
shows the available appointments for a specific day. Assume two bound
fields (date, name), and for the specific day 10 available records at
30 minute intervals, say beginning at 09:00, 09:30, 10:00 ... ending
at 13:30.

Sometimes I need to assign more than one 30 minute appointment to the
same person. Taking a specific example I would like to assign 10:00,
10:30 and 11:00 to the same person.

Once I enter the name in the 10:00 slot, I would ideally like to click
on the record selector to the left of the 10:00 slot and drag the
cursor to the 11:00 record selector and have the name replicated in
all 3 time slots.

I tried using MouseDown. This can identify the name value in the 10:00
slot. I dragged the cursor and hoped that MouseUp would identify the
value in the 11:00 slot. It did not. It identified the value in the
10:00 slot.

Any ideas on how to perform this multiple record selection and
manipulation?

I think you should be able to use the Form's SelTop and
SelHeight properties to do waht I think you want. Here's
some untested air code with the general idea:

Dim TheDate As Date
Dim TheName As String
Dim k As Integer
If MeSelHeight > 1 Then
With Me.RecordsetClone
.AbsolutePosition = Me.SelTop
TheDate = !thedatefield
TheName = !thenamefield
For k = 2 To Me.SelHeight
.MoveNext
If .EOF Or Not (IsNull(!thedatefield) And
IsNull(!thenamefield Then Exit For
!thedatefield = TheDate
!thenamefield = TheName
Next k
End With
End If

--
Marsh

Reply With Quote
  #3  
Old   
JohnP
 
Posts: n/a

Default Re: Form-Multiple record selection/manipulation - 01-26-2011 , 05:56 AM



Excellent. This is much simpler and cleaner than other ways of
achieving this, by using say MouseUp in conjunction with a Click (on
the last selected record) and making sure that the coordinates of the
Click are close to the coordinates of the last selected record.
Many thanks,
John

Reply With Quote
  #4  
Old   
JohnP
 
Posts: n/a

Default Re: Form-Multiple record selection/manipulation - 01-26-2011 , 10:47 AM



Just one more thing. Is there any way to distinguish whether the
selection is made down the table or up the table. For example,
starting from record 10 in the form, I can select records 10, 9, 8 or
10,11,12. We cannot assume that the appointment times are ascending,
since the user may include more than one appointments for the same
time. Any ideas?

Reply With Quote
  #5  
Old   
Marshall Barton
 
Posts: n/a

Default Re: Form-Multiple record selection/manipulation - 01-26-2011 , 12:54 PM



JohnP wrote:

Quote:
Just one more thing. Is there any way to distinguish whether the
selection is made down the table or up the table. For example,
starting from record 10 in the form, I can select records 10, 9, 8 or
10,11,12. We cannot assume that the appointment times are ascending,
since the user may include more than one appointments for the same
time.

If Me.Recordset.AbsolutePosition+1 = Me.SelTop Then
' selection was down
Else
' selection was up
End If

--
Marsh

Reply With Quote
  #6  
Old   
JohnP
 
Posts: n/a

Default Re: Form-Multiple record selection/manipulation - 01-27-2011 , 08:12 AM



Marsh,

Many thanks for your reply. I managed to do something similar to what
you mention.
John

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.