is the screenshot of your form a subform, or part of the main form?
What is the error message you're getting?
I don't use bound forms at all but I did some very basic testing and was able to get expected results in both a continuous main form and continuous subform arrangement and did not receive an error.
Why do you need to move the records, you can use the Orderby property to sort the records the way you want.I have a database that has multiple records I added two click buttons and added code so that they can move records up or down depending upon when I need them moved.
Here are some snapshots of the code and the buttons.
my guess is that he's got some sort of manufacturing process and he wants to reorder the steps on the fly and the only way to do that is to assign them a priority within a particular job.
so what happens if you comment the setfocus line out?
What behavior are you trying to accomplish.
When you click the 'move up' button you want the renumbering to occur but then what?
Stay on the 'current' record (stay on the step labeled 3 after the resorting)
Move to the 'adjusted' record (if a sort currently says 2 and you change it to 1, move to the 1 record)
Do you have a primary key for the table containing the items in the subform? Have you tried referencing records using the PK? What are you trying to accomplish with the line me.designsort.setfocus? if you're attempting to move to a specific field on the 'current' record you can use docmd.gotocontrol "SetFocus".
isn't that the functionality you're looking for? Looks to me like you changed the order correctly. Or are you saying that you want your cursor to stay on the item with SORT 2 after the sort is complete? I don't understand what the issue is based on your screenshot looks like the sorting is happening correctly.
Well you see those screen shot are from another subform that also has the same coding as this one it just wont work on this one I can't figure it out. they are exactly the same nothing different just the information that is in the form is different. but everytime i press up or down on the subform with the compile error it wont work.
how about creating a sample database (copy your database and clear out any private information, but leave enough fake data in to mimic your problem) then compact/repair and zip it up and load it to this site.
okay here you goDLDB Desktop.zip
Hi -
I think it is a simple answer -
Me.DesignSort.Setfocus should be me!Designsort.SetFocus, using ! instead of a period.
Ms Access can be very fussy at times about when you do and do not have to use ! to indicate a form control or a recordset field, and I suspect this is one of them.
HTH
John
okay i guess it didnt work how can i add files?
you go through the attachment wizard in the GO ADVANCED button at the bottom right of your post.