Change Backcolor for the selected line

I would like to be able to highlight or change the color of a single line on
a subform formated as a continuous form.

The user selects one line from many possible lines on a continuous form to
respond to. When he selects the line another pop-up form is display which the
user must complete.

I would like to maintain some kind of highlight (backcolor?) so that the user
can clearly see which line he is reponding to.

Setting the backcolor after selecting a line sets the back color for the
entire form, which really defeats the purpose.

Any help?

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200912/1

0
al416
12/4/2009 9:28:32 PM
access.formscoding 7493 articles. 0 followers. Follow

1 Replies
760 Views

Similar Articles

[PageSpeed] 7

Instead of using a line, use a textbox -- make it short and 
wide like a line.  Use conditional formatting for the 
textbox backcolor so your lines can be different colors for 
different records depending on your criteria <smile>

You will also want to set these properties:
Locked = True
Enabled = False

~~~

or are you using "Line" to mean the record of data?

TO HIGHLIGHT THE CURRENT RECORD IN A CONTINUOUS FORM

put the following textbox control on your form (I usually 
put it in the footer since there is often more unused space)

name --> RecordID_current
visible --> no

make the following textbox control in the detail section of 
your form:

name --> HighlightBox
left --> 0
top --> 0
width --> width of detail section
height --> height of detail section, like 0.2
enabled --> false
locked --> true
tabstop --> false

send this control to the back*

in the design view of the form, select HighlightBox
since HighlightBox is behind everything, you may need to 
select it using the object drop-down (1st icon on the 
formatting toolbar or combo in the Properties window at the 
top)

conditional formatting
condition 1 --> Expression Is
--> [RecordID] = [RecordID_current]

example to also highlight a new record:
     [RecordID_current] = nz([GrpID],RecordID_current)

change fill/back color to LIGHT YELLOW or  light gray
or whatever color you want for your highlight

If my detail section background is White, I like to use 
light yellow for a highlight

WHERE
RecordID is the controlname of your ID field control

then, in the form OnCurrent event, assign a value to the 
unbound RecordID_current
being unbound, it will have the same value on every record

'~~~~~~~~~~~~~~~~~~~~~~~~~
Private Sub Form_Current()
    Me.RecordID_current = IIf([NewRecord], 0, [RecordID])
End Sub
'~~~~~~~~~~~~~~~~~~~~~~~~~
'~~~~~~~~~~~~~~~~~~~~~~~~~
'needed in Access 2007
Private Sub Form_BeforeInsert()
    Me.RecordID_current = me.RecordID
End Sub
'~~~~~~~~~~~~~~~~~~~~~~~~~

where [RecordID] is the controlname (or fieldname) 
corresponding to your unique ID.


Warm Regards,
Crystal
remote programming and training
http://MSAccessGurus.com

free video tutorials
http://www.YouTube.com/user/LearnAccessByCrystal

Access Basics
http://www.AccessMVP.com/strive4peace
free 100-page book that covers essentials in Access

  *
    (: have an awesome day :)
  *


al416 via AccessMonster.com wrote:
> I would like to be able to highlight or change the color of a single line on
> a subform formated as a continuous form.
> 
> The user selects one line from many possible lines on a continuous form to
> respond to. When he selects the line another pop-up form is display which the
> user must complete.
> 
> I would like to maintain some kind of highlight (backcolor?) so that the user
> can clearly see which line he is reponding to.
> 
> Setting the backcolor after selecting a line sets the back color for the
> entire form, which really defeats the purpose.
> 
> Any help?
> 
0
Crystal
12/4/2009 10:01:08 PM
Reply:

Similar Artilces:

undo changes
Hi I have a form which is opened with a record in, but I want a button to undo any changes which have been made since the form was opened. The line DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70 does not work as it says the command or action 'undo' isn't available now. I am using access 97 any advise is appreciated. Jon There is not a simple way to do that, Jon. Access saves each record as soon as you move to another one. To undo all changes made since you opened the form is not something it supports. In Access 2000 and later, it is possible to progra...

changing multiple custom headers at once
Hi I would like to be able to make the same change to multiple headers that are custom in several sheets of the same workbook is this possible? Thanks Karl Hi just select all these sheets before changing the header/footer (hold down the CTRL key while selecting the sheets) -- Regards Frank Kabel Frankfurt, Germany Karl wrote: > Hi I would like to be able to make the same change to multiple > headers that are custom in several sheets of the same workbook is > this possible? Thanks Karl Karl Right-click on a sheet tab and "Select all Sheets". Make your changes to...

Convert text to table macro from current selection
Dear Experts: below macro converts the current selection (three lines with words separated by tabs) into a table featuring 4 columns and three rows and formats it with a user-defined table style. Example (see code below): text(tab) text(tab) text(tab) text text(tab) text(tab) text(tab) text text(tab) text(tab) text(tab) text How can I expand the macro to perform the following tasks on any selection: Example: .... retrieve the number of tabs in the first line of the current selection (e.g. 6). 6 (six) tabs means 7 (seven) columns .... retrieve the number o...

I can still select & manipulate locked & protected cells in '07
I have an Excel 2007 worksheet that rotates between locked and unlocked rows. I protect the document correctly (checking the boxes “select unlocked cells” & “format cells”), but I am still able to indirectly select and manipulate the locked cells. To do this I select an unprotected cell and drag the cursor vertically over any number of unprotected and protected cells and then end the drag on an unprotected cell. This highlights (and selects) both the unlocked & locked cells and I am able to manipulate all of them freely (i.e. changing the background color etc.). How can I...

Change the Default Comment Format to NOT be bold
I have changed the DEFAULT font on the comments by doing the following: 1. Right-click on the desktop, and choose Properties. 2. On the Appearance tab, click Advanced. 3. From the Item dropdown, choose Tootip 4. Choose a font size, click OK, click OK. . . . . . and I see where there is an icon to click to turn the Bold function on and off; but it is not working for me. Is this just the way it is? or am I doing something wrong? I do not want the default for comments to be bold. ...

Deadlock on SQL SELECT statement
I have inherited the maintenance of a product which includes the snipet of code below. Every 10 seconds the code is executed. It is causing a deadlock in some instances, but I am undable to reproduce the problem on my machine. The "PC" table contains a list of PCs seen on a network, so isn't very large. Since I dont have much background in database programming, I was wondering if there is some simple answer to the deadlock issue...but from reading on deadlocks, there rarely seems to be a simple solution. //**************************************** // Find PCs to restart CStri...

Query based on selection in form (Datasheet view)
I would like to make a query based on a selecion (more than one selection) in a subform in datasheet view. the point is to be able to use this query as a base for sending email to the selected posts, delete the selected posts or perfor other functions. ...

changing filter arrow colors
When using the filter option, if you have a large number of columns filtered it is difficult to determine which field arrows are filtered and which are not due to the small arrow on the filter arrow changing to blue vs the unfiltered arrows remaining black. If there was a more distinct color change, ie bright red it would be easier to determine which column was filtered. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do ...

How do I get the lines to stop printing in my pictures?
I am printing a brochure and I have lines going through my picutre. You can't see them until you print the brochure. I have gone into the formatting options and on color and lines I have taken out the lines but as soon as I get out of the options the lines come back. How can I keep them out of the picture? Could be your picture is corrupt. See if re-inserting it helps. Is your printer driver current? Check with the manufacturer's web site. What version Publisher? Is the brochure a template or are you creating from scratch? I am not sure this article is helpful in your situation...

How to change the font used in register ? M2K5
How to change the font used in register ? M2K5 I want to use Money register with my native font. Although I can change windows appearence fonts from Desktop-Peoperties-Appearence to My Native Fonts. There is no change in money. Thanks in advance. k0zaw2005 ...

Outlook 2000
I have Outlook 2000 installed and running. Formerly, I had Outlook 2002 installed and running. With 2002, I had the option of choosing an account/service from which to send a newly created message. How can I get this function to work in Outlook 2000. Apparently, simply choosing a "From" address does not work well. Please help. Thanks. Check Help->About - if it says Corporate or Workgoup, you can no longer use the previous settings. You will need to change the sending order under Tools->Services. --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the...

How do I change the ruler to inches in access
It's generally considered polite to put your question in the body of the post, rather than strictly post a subject. As well, details such as what version of Access and of Windows can be useful. That having been said, Access gets its unit of measure from the operating system. The only way to have the ruler in Access be in inches is to choose U.S. rather than Metric for the Measurement Units in Regional Settings in the Control Panel. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "Johnotaker" <Johnotaker@discussions.microsoft...

Changing date formats in Excel
I am importing data that has a date format mm/dd/yy and want to find an easy way to convert this date to dd/mm/yy. I would appreciate any assistence anyone can offer -- fdoherty ------------------------------------------------------------------------ fdoherty's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=25144 View this thread: http://www.excelforum.com/showthread.php?threadid=386390 Format Cells -> Date Select English (United Kingdom) as Locale. "fdoherty" <fdoherty.1s1zuv_1121166329.0795@excelforum-nospam.com> wrote in message news:f...

How to change Bridgehead server?
I'm migrating to Exchange 2003 from 5.5. Have the old 5.5 server and the new 2003 server the same Site/Administrative Group. I've moved all mailboxes to the 2003 server, and have added an SMTP connector to the 2003 server and added our domains to the address space tab , and have pointed DNS/MX records to the new server and it is receiving new mail just fine. All users connect to the new server to send/receive mail. I notice though in the email header of outgoing mail to other domains that the server that sent out the email is the old 5.5 Servername/IP Address. If I stop the...

Line Chart x
Hi I want have my excel line charts updating automatically when new data is added every quarter. I also want the x – axis display as e.g. 2008Q1 or Q1 dec – 2008. I have at the moment mmm-yyyy, so it is in date formula so it updates automatically, however when a second axis e.g. Q1 is underneath it either won’t allow me to update automatically or there will be a large amount of blank space representing where I have chosen the source data to go to. So is it possible to have two x –axis one date and one text or to have one x – axis displaying date and text on charts that will automaticall...

OWA changing password problem
When I log onto OWA to change my password, th Internet Service Manager pops up just like it should And all the fields are empty except for the ACCOUN field The problem is that the first letter is missing Exchange2003 on win2003 DC I have the exact same problem. I believe it to be an AD issue since I've seen the same thing with other products. Anyone have any ideas? "gottado" wrote: > When I log onto OWA to change my password, the > Internet Service Manager pops up just like it should. > And all the fields are empty except for the ACCOUNT > field. > The problem ...

How to display a msgbox if on data change if field value wasn't nu
Is this possible to accomplish? A field (MyField) contains some text. When a user changes or deletes that text, I display a message box asking the user if he really wanted to change the text in MyField. The way my code is set up, the message box displays after every data change. (I'm not very good at writing code.) Dim ChgAnswer As Integer, MsgTitle As String, MsgDialog As Integer Const MB_YESNO = 4 Const MB_ICONEXCLAMATION = 48 Const MB_DEFBUTTON1 = 0, IDYES = 6, IDNO = 7 If Not IsNull(Me.MyField) Then Beep MsgTitle = "Data Change" MsgDia...

Off-line Register
Hi, We have a store with 2 registers, we need to be able to have a 3rd one that we can use off-line. We sometimes go on the road with some inventory and we need to be able to sell it, give receipts, take payments and when back in the store, sync all the sales and inventory with the main database. Does anyone knows what is the easiest way to do this? does the Mobile suite from New West Technologies works?, Where does the mobile cashier prints the receips when off'line? any ideas? Thanks, Sacha 1. Create a local db (using server "(local)") for off-line use. 2. Configur...

Format paragraphs and keep last line with same line space
I use shift-enter to end a line until I get to the end of a paragraph when I press Enter/ Return. This results in both display and print copies with a larger line space for the last line of the paragraph and makes the whole thing look uneven. How can I make each line space within this paragraph to be the same? Instead of using the shift-enter, why not just set your text box up to the proper width and allow the text to wrap accordingly? -- JoAnn Paules MVP Microsoft [Publisher] "Cyprus Harry" <Cyprus Harry@discussions.microsoft.com> wrote in message news:6F32306F-F5...

How do i get the excel worksheet to automatically add or change c.
...

Changing the default folder view when opening or saving a file
In PowerPoint 2003, when clicking file>open to open an existing file, the “open” window defaults to the List view. Can the “Details” view be saved as the default? ...

automatically copy a line in word
I am using MS office 7. I wish to set up a template which allows me to write a one off letter to a client. Within the letter I wish to customize the odd line or paragraph which will then be automatically repeated at a specific point further down the document. I can do this to a degree using mail merge but its something of a phaf so is there a way I can use, say, ‘quick parts’ in the insert ribbon to do the same? Any responses will be greatly appreciated. Office 2007? (That's actually Office "12", I believe.) I'll assume you're talking about Word. ...

Formula's don't link after a file name changes #2
Thanks for the advice. What would you suggest to do when you hav several (close to 40) spreadsheets and each one has multiple formula in it? Would a Ctrl+H work on all the formulas in the spreadsheet at once, o do I need to do it cell by cell? Thanks, Da -- DPelc ----------------------------------------------------------------------- DPelch's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1466 View this thread: http://www.excelforum.com/showthread.php?threadid=26281 Dan, It will work on all the cells that you select, if you select more that one cell, or on ...

How do I change the scale of part of an axis in a graph on Excel?
I have a graph that needs to use a large scale up the top, but down the bottom I was wondering if I could 'squash' the scale. I think it's possible to do this in another application (Datastudio) where it inserts a 'squiggly line' between parts of the scale it collapses/squashes. This is in Excel 2003. Thanks http://peltiertech.com/Excel/Charts/BrokenYAxis.html may help ? -- David Biddulph "Secateurs" <Secateurs@discussions.microsoft.com> wrote in message news:7A0E68A1-E26B-448A-A406-831D751D677C@microsoft.com... >I have a graph that needs to use a ...

Changing Groups at Runtime !
I currently have a report which is grouping on my field "GROUP1" which gets changed by my sql at runtime. The SQL my report is using is Select [Client Data].State as GROUP1 , 'State' as Gr1pName , * FROM [Client Data] However it still keeps asking me for a paramater value for STATE in a message box Any ideas how I can stop this from happening ??? Thanks in advance ...