Edit Priority Rank List

Hi,

I am creating a projects data base. I would like to be able to reorder the 
projects priority ranking without reassigning each ranking to every project. 
Based on a similar question posed online and advice from ScottGem (see 
below), I have created an update query to add one to the rank list of 
projects that have a priority rank of greater than or equal to the edited 
value. I am having trouble with this. I have created a form called 
frmUpdateRankList that has an unbound combobox and a list box that displays 
the current projects sorted by rank order.  I would like the user to select a 
project from the list and then select a new rank order from the combobox. 
This will initiate an afterUpdate event. The code then runs the updatequery 
to increase the ranking of all projectes with a priority rank greater than or 
equal to the value selected in the combobox. This works ok. I would then like 
to get the original priority ranking of the selected project replaced with 
the number selected in the combobox. I can not get this to work. Any ideas on 
how best to do this? Any help is greatly appreciated.

Scott's Answer
Create an update query that sets the priority field to:
[Priority] + 1
then set the criteria to
>= new number
Where new number is the rank of the new number. 
This will increment by one each priority.
Hope this helps,
Scott<>

My code:

Private Sub cboNewRankOrder_AfterUpdate()

Dim ListBxCount As Integer
Dim ListBxCounter As Integer
Dim X As Integer
Dim intNewRankOrder As Integer

intNewRankOrder = Me.cboNewRankOrder

'set X = 0
X = 0

'Check to see if an item was selected
ListBxCount = ListBxRankOrder.ListCount - 1
For ListBxCounter = 0 To ListBxCount
    If ListBxRankOrder.Selected(ListBxCounter) = True Then
        X = X + 1
    End If
Next ListBxCounter
If X = 0 Then
    MsgBox "You must select a project!"
    Exit Sub
End If

DoCmd.SetWarnings False 'suppresses action query warnings
DoCmd.OpenQuery "UpDateQryRankOrder"
DoCmd.SetWarnings True

'set selected listbox item to new sort order
Dim db As Database
Dim rstEvents As DAO.Recordset

ListBxCount = ListBxRankOrder.ListCount - 1
For ListBxCounter = 0 To ListBxCount
    If ListBxRankOrder.Selected(ListBxCounter) = True Then
        Set db = CurrentDb
        Set rstEvents = db.OpenRecordSet("tblProject")
        rstEvents.Edit
        rstEvents!RankOrder = intNewRankOrder
        rstEvents.Update
        ListBxRankOrder.Selected(ListBxCounter) = False
    End If
Next ListBxCounter

End Sub

0
Utf
5/8/2007 4:06:03 PM
access.formscoding 7493 articles. 0 followers. Follow

0 Replies
855 Views

Similar Articles

[PageSpeed] 13

Reply:

Similar Artilces:

Distribution list to some one else and they can use them?
Distribution list to some one else and they can use them? I send them to my boss but, they being sent a rich text files. AS rich text file he can, not use them to send message. I need to beable to use them Insert them as an Outlook Item in a message in RTF format. Then he can just double click it to open and it will be save to his default Contacts Folder. -- Russ Valentine [MVP-Outlook] "Anthony Frisoli" <Frisoliap@UPMC.edu> wrote in message news:00bd01c49500$4ca97890$a401280a@phx.gbl... > Distribution list to some one else and they can use them? > I send them to m...

Ranking #2
Hi I am trying to get excel to rank scores and then I will use a lookup to get the highest rank, however my scores have ties and sometimes have 2 first places and 2 second places. Is there anyway to get excel to simply take the top5 numbers of a range and to rank them say 1st, 1st, third, third, fifth? thanks doug Hi see: http://www.xldynamic.com/source/xld.RANK.html and http://www.cpearson.com/excel/rank.htm >-----Original Message----- > >Hi > >I am trying to get excel to rank scores and then I will use a lookup to get >the highest rank, however my scores have ties...

mail priority handling
Can someone tell me how exchange handles emails that get backed up in a queue? specifically, does it process the first email that came in first or does it process the most recent email to the oldest (the first in the queue)? if you know the answer, can you provide me a link to a paper that explains that? thanks in advance, ben FIFO. "ben" <anonymous@discussions.microsoft.com> wrote in message news:994501c3ea74$b90f9d20$a601280a@phx.gbl... > Can someone tell me how exchange handles emails that get > backed up in a queue? specifically, does it process the > firs...

Editing Text when using Publisher as a web page...
I'm using Publisher to document the status of current taskings in the office. I'm trying to ger Publisher to allow people that pull up the web-page to add and edit text on the web page so we can keep everything up to date. Right now, someone has to come to me and tell me the changes, then I change the info in the Pub doc, then I have to repost the web-page. Is there a way for people to edit the text on the web-page when they pull it up. I have text boxes in there now that people can edit, but the text doesn't update when you close the page and re-open it. Please Help if you ...

SQL Server 2000 Standard Edition vs SQL 2000 Personnel Edition
I am using SQL server 2000 standard Edition sp3 with Gp 9 Sp3, I am planning to move GP with database to new server different hardware. can I use sql 2000 personnel edition sp3 or should I use same old version. I hope u understand my question. MK KSA Generally speaking, personal editions are not robust enough to support a product like GP. I would stay away. -- Richard L. Whaley Author / Consultant / MVP 2006-2008 Documentation for Software Users Get our Free Tips and Tricks Newsletter and check out our books at http://www.AccoladePublications.com "MK KSA&quo...

editting auto recovery
Hello, is it possible to change the auto recovery directory just for one document and is also possible to ensure that the auto recovery file is not deleted after the file is closed? Cheers Hi AFAIK this is not possible. But you may consider using the following add-in: http://www.jkp-ads.com/Download.htm (look for AutoSafe.zip, not autosafeVBE.zip, for your purposes.) -- Regards Frank Kabel Frankfurt, Germany Hcoms wrote: > Hello, > > is it possible to change the auto recovery directory just for one > document and is also possible to ensure that the auto recovery file > ...

BOM & Edit List
Hi, I created an Assembly transaction and printed it from the Assembly transaction entry window before posting it. In the posting journal that prints it does not print the Assemble cost, extended assemble cost, Unit cost of the components and the extended cost. But if i post the transaction then the same posting journal is printed with the costs. Why does it not print? Please let me know Thanks Dev It only pulls posted costs, like other Great Plains edit lists including items. You will need to modify the report to include costs. "Dev" wrote: > Hi, > > I created...

template edit question, add more? edit template?
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel i'm using a resume template and it's beautiful, but only allows four job positions before it moves one the education, etc. <br><br><i>guess theres a way to do it on the pc version, but with mac, how do i insert an addition formatted block? it will only let me work within the template currently.</i>&#32;<br><br><i>hope that makes sense, thanks for the help!</i> Mac or PC makes no difference � it's a matter of how the template is constructed. With...

How to edit entitys attributes directly?
I messed up with entity mappings and ended up with errror: attribute not found. How can I manually remove attribute from entity? Tried export -edit -import but it seems not to be the right way. You will first need to remove the "bad" mapping that you created. Since it is referncing the field, you need to do that prior to trying to remove the field. You also need to remove it from any forms & views that may be displaying it. The customization Import will not remove fields (as you have discovered). That is done as a safety feature to rpevent accidental loss of data (ima...

Customization of CRM Activities List Page...
Hi, I want to display the creation date time column on Activities List page in MS CRM. I didnot find any customization available for Sub links like Activities, Notes........... Also if some one can tell how to change the Status of an Activity. Regards, BizWorld activity views are not customizable in this release. Same story with activities in general. Expect this to change in a later release of crm -- John O'Donnell Microsoft CRM MVP http://www.mscrmfaq.us "BizWorld" <moonis.tahir@gmail.com> wrote in message news:1114122380.225434.54140@f14g2000cwb.googlegroups.com...

Editing
Hi! Could you please tell me how to remove a linked transaction within the budget planner. For example, I have a double entry under the debt category. ...

Macro to edit details
Hi, i am currently trying to create a macro regarding editing staf details on a worksheet....... therefore i recorded a macro and named it editstafflist, i highlighte my headings...and then went to 'data > form' and then had to close th form and then stop my macro. It wouldnt allow me to stop my macr whilst the dialogue box was open. Anyways after stopping the macro drew out a button and assigned this 'editstafflist' macro to it. saved my sheet and then clicked on the button, but a error '1004' kep occuring, can anyone please help me on this as i am rather stuck ...

editing a drop down #2
that's not one of my choices. -- kateweb ------------------------------------------------------------------------ kateweb's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=16301 View this thread: http://www.excelforum.com/showthread.php?threadid=276931 what do you mean by this .. is it greyed out on the toolbar or shows "any value"? if you'ld like to tell me where you downloaded it from i can go have a look at it cheers JulieD "kateweb" <kateweb.1fictb@excelforum-nospam.com> wrote in message news:kateweb.1fictb@excelfor...

All Staff List
Win Nt with Exchange 5. I have an all staff list and have recently updated it, added new people deleted some whom have left our office But now when anyone sends an All-Staff e-mail they get two e-mails back saying the e-mail was undeliverable to the following recipient(s) could not be reached: Even though I have gone through the list and made sure that it is up to date. It seems like the list is not updating when people are deleted Is there a solution to this that anybody knows. Would be a help rather than delete the all staff list and recreate it Restarting MTA should fix that. Lizzy wr...

distribution lists
Hello everyone. I'm new to this group and just wanted to say hello to all the newbie exchange 2010 admins out there.. ;) Can someone please point me in the right direction to try and understand why distribution list sharing is so problematic, at least in my experience. We have a user who shared out their dl to a group. When the members of the group attempted to open the distribution list, internal and external recipients, they would receive an error, 'invalid contact would you like to delete, fix'. I noticed if you click cancel, it drops you back to the dl and the icon...

Setting caret in edit control & activating it.
Hello Does anyone have any example code for setting and enabling the caret in an edit control ? Nicholas Take a look at the CEdit::SetSel() member function. -- Cheers Check Abdoul [VC++ MVP] ----------------------------------- "Nicholas Kingsley" <nickk@nildram.co.uk> wrote in message news:3f9d418a$0$106$65c69314@mercury.nildram.net... > Hello > > Does anyone have any example code for setting and enabling the caret in an > edit control ? > > Nicholas > > If you are asking how to create & use your own caret in an edit control then check...

Data collection Form Edit
We have a form which will be used almost daily, for data collection, based on a query. During the test we found a typo in one of the field labels where a brief description is included. Is there some way to edit the form? (recreating it with all the custom lables is just too long a task). Another issue on this topic, every time the form is sent, the messge reverts to the default "Please fill out the form and retunr it to me". Can this default message be changed? Nothing in the help functions. Any advice, or deirection to a learning resource will be appreciated. Thanks is adva...

HOW TO
I need to know how to extract/recieve/get a list of user smtp addresses from AD/GAL/Exchange so that I can make a report. This is a very basic process in ANY OTHER mail server but microsoft makes admin life insanely hard with leaving out a basic function such as this. Please do not send me a script link from some ADO CDO site without a sound explanation of how to use it. I need a functional way within AD/GAL/Exchange to do this, not some developer code process, can anyone answer this question? MS experts? anyone? Thanks in advance, http://www.suneja.com/blog/2005/09/how-to-export-all...

"Windows PowerShell Cookbook" by Lee Holmes second edition draft available for viewing and comments
O'Reilly Books has made the working text of the PS V2 second edition of Lee Holmes' "Windows PowerShell Cookbook" available for viewing and comments at http://powershell.labs.oreilly.com/ - Larry In message <exi7SKRyKHA.2552@TK2MSFTNGP04.phx.gbl>, Larry__Weiss <lfw@airmail.net> writes >O'Reilly Books has made the working text of the PS V2 second edition >of Lee Holmes' "Windows PowerShell Cookbook" available for viewing and >comments at > > http://powershell.labs.oreilly.com/ > > - Larry > Aw...

Exporting Global Address list
Hi, Is it possible to export the "Global address list" into a file and then import the file into the outlook contacts. Or can it be exported as a "PST" file? Thanks. Mitch Not directly but you can export using another tool such as: http://www.imibo.com/imidev/Exchange/imige.htm NUe "mitch" <mitch@discussions.microsoft.com> wrote in message news:ABDE139E-1970-4D57-8749-8FB66548CD52@microsoft.com... > Hi, > Is it possible to export the "Global address list" into a file and then > import the file into the outlook contacts. Or can it b...

Having Insert button functionality while editing
Hi, I want to have the functionality of Insert button (on keyboard) in my while application while editing in a cell or a edit box. For eg if i am editing my text say "alpha" and my cursor is between "l" and "p" and I insert an alphabet say "z", i want the "p" should be replaced by "Z" and the text should become "alzha". Please suggest. Thanks in advance. Regards, Arjun CEdit does not support that by default. Here is a good example of how implement this (Although I think UpdateCaret should just be a method of CXEdi...

How do I find where I stopped editing a document?
In Word 2003, I could use Shift F5 when I opened a document to find where I left off editing it the last time I opened it. This doesn't seem to work in Word 2007, at least not consistently. Is there some other menu item or keyboard shortcut I can use, or are there some circumstances under which Shift F5 will work? Unfortunately, it doesn't work in XML (*.docx) documents, only those saved in Word 97-2003 format. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA http://word.mvps.org "Shortcut Jane" <Shortcut Jane@discus...

Worksheet list
Hi: I have 63 worksheets in one document. How can I prepare a list of their titles? Many thanks, Angel Sub PrepareList() Set MyList = Worksheets.Add for i=1 to Sheets.Count MyList.Cells(i,1).Value = Sheets(i).Name Next End Sub Bob Umlas Excel MVP "Angelina" <anonymous@discussions.microsoft.com> wrote in message news:1a8b01c47c1f$2285a1f0$a501280a@phx.gbl... > Hi: > > I have 63 worksheets in one document. How can I prepare a > list of their titles? > > Many thanks, > > Angel THANK YOU SO MUCH! IT WORKED! >-----Original Mess...

Problem with extending list formats and formulas
Hey all- I'm having a problem with extending list formats and formulas using Excel 2000. I know there are limitations to what that feature can do, but I thought I'd check here, since I have a very simple example that isn't working. I create a sheet with two columns. In the column A, I just enter any arbitrary number in each of the first 10 cells. For column B, I want to calculate the difference between the last two values in column A. In other words, B2's formula is =A2-A1, and B3 = A3-A2, etc.. I copy this formula down the first 10 cells of column B (skipping the first r...

need example code to get the contactID from SFA/conts/edit.aspx...
Hi!! My question is: How can I get the right ContactID from the current/opened Contact in Microsoft CRM? Can I read the ContactID out from the URL? Is there an example Code available? Microsoft�s SDK for CRM is not very helpful for this Problem. Has anybody already an example code? Thank you for your help! Greetings Daniel You should be able to get it from the query string, as long as you make sure that the entry in the isv.config file with the link to your app has the variable "PassParams" equal to 1 For example: <Button Title="Test" ToolTip="Info on Test&qu...