Referencing a subforms recordset

  • Thread starter Thread starter Fysh
  • Start date Start date
F

Fysh

I posted last with a problem and recieved a good answer
from Marshall. I was able to get this language to work if
I place it on the subform. However, instead of place the
up and down arrows on the subform, which would display one
for each row I would rather just have one on tha main form
to update the table. Here is the problem I have a main
form with 2 subforms when someone selects an item from the
first subform the second subform is updated to display
realted items in sequential order. What I am trying to do
is if someone creates an item give them the option of
changing the sequential order to be used for later
purposes. I hope this makes sense. Here is the code so
far:

Private Sub AttUp_Click()
Dim lngOrdNum As Long

With Me.RecordsetClone
.Bookmark = Me.Bookmark
If .AbsolutePosition < .RecordCount Then
.Edit
lngOrdNum = !Ordering - 1
!Ordering = lngOrdNum
.Update
.MovePrevious
.Edit
!Ordering = !Ordering + 1
.Update
Me.Requery

.FindFirst "Ordering = " & lngOrdNum
Me.Bookmark = .Bookmark
Else
Beep
End If
End With
End Sub

I want to place this on the main form and when someone
selects an item on the subform then presses the arrow on
the main form button have it move up in order. Can
someone assist on this? Thanks
 
Instead of:

With Me.RecordsetClone

Try:

With Me.subFormName.Form.Recordsetclone

Where the subformname is the name of the control on your
main form, not the actual name of the subform.

HTH
Dale
 
That seemed to do the trick I don't know why I didn't see
that. One more thing though. I click on the item of the
subform then click on the button on the main form and it
moves the item up on the subform. How do I keep the row
selected in case the person wants to move it up twice or
whatever? Right now after the update the cursor goes to
the first row on the subform.
 
never mind, got it. Thanks anyway
-----Original Message-----
That seemed to do the trick I don't know why I didn't see
that. One more thing though. I click on the item of the
subform then click on the button on the main form and it
moves the item up on the subform. How do I keep the row
selected in case the person wants to move it up twice or
whatever? Right now after the update the cursor goes to
the first row on the subform.
.
 
Back
Top