MS Access
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Tutorialized ForumsDatabasesMS Access

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Tutorialized Forums Sponsor:
  #1  
Old October 26th, 2009, 11:33 AM
OldManRiver OldManRiver is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Jan 2009
Posts: 16 OldManRiver User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 25 m 53 sec
Reputation Power: 0
MySpace
Data Row Problem

All,

Attempting something I have not tried before. Have the form shown at:

http://imagebin.ca/view/Rv5YCvvc.html

Need to accomplish the following on the subform:

1. Change color, row by row, for different status values,
2. Change value, row by row, from either drop-down or pop-up.

I actually only need to change/manage color and value in the "Status" column.

I can get the right values, on double-click, but when I attempt to set them all the rows set, not the individual one. I know this is needing an index for the row, but since I've not done this before, do not know what index I am looking for. Also I do not know what I should be searching for, so not getting and online help.

URLs to HOWTOs please.

Thanks!

OMR

Last edited by OldManRiver : October 26th, 2009 at 11:44 AM.

Reply With Quote
  #2  
Old October 27th, 2009, 09:41 AM
OldManRiver OldManRiver is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Jan 2009
Posts: 16 OldManRiver User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 25 m 53 sec
Reputation Power: 0
MySpace
Conditional Formatting - Not the Answer

All,

I appreciate the inputs on condition formatting, but it is limited to just 3 values, where I have 9.

What I need is for the functionality of conditional formatting in vba so I can fill in the row, setting the color as it sets, then change the column and reset the color, and finally save all this.

Notice I am not using the Nav Bars, etc, so even though the subform is a bound form, this is readonly to the screen and save is handled seperate with a button, as there are 5 tables involved, which are outside of a pre-defined relationship.

Thanks!

OMR

Reply With Quote
  #3  
Old October 30th, 2009, 04:09 AM
OldManRiver OldManRiver is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Jan 2009
Posts: 16 OldManRiver User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 25 m 53 sec
Reputation Power: 0
MySpace
Examples

All,

So after following all the links and much more research I was either directed to or found 5 examples of how I should do this, which are in the file at:

http://filebin.ca/onqyan/CondFormat.zip

File0 ==> Is one with Bitmap Image and works, but cannot apply to my program as somehow this one gets a value for the combobox field and mine does not. With all my efforts I can not duplicate the ability to get a value in my field, nor is there any detail on how to set the color bitmaps in the database, which is critical.

File1,2 ==> Of no value at all.

File3 ==> Coloring and code are interesting but has no combobox so not sure of any value.

File4 ==> Good code but not Continuous Form so not sure of the value.

Still searching and not finding, so may have to write this one my self. The sites at:

http://msdn.microsoft.com/en-us/library/aa139965%28office.10%29.aspx
http://blogs.msdn.com/frice/archive/2004/06/08/151178.aspx
http://www.experts-exchange.com/Microsoft/Development/MS_Access/Access_Forms/Q_22940240.html

all suggest this code to set up conditional formatting object values:
Code:
Sub TKT_DInit()
    Dim objCond As FormatConditions
'    Set objCond = TargetForm.[cboxHST].FormatConditions.Add(acExpression, , (TargetForm![cboxHST].Value = "Entered"))
'    Set objCond = TargetForm.[cboxHST].FormatConditions.Add(acExpression, , (TargetForm![cboxHST].Value = "Approved"))
'    Set objCond = TargetForm.[cboxHST].FormatConditions.Add(acExpression, , (TargetForm![cboxHST].Value = "Deficiencies"))
'    Set objCond = TargetForm.[cboxHST].FormatConditions.Add(acExpression, , (TargetForm![cboxHST].Value = "Client Approved"))
'    Set objCond = TargetForm.[cboxHST].FormatConditions.Add(acExpression, , (TargetForm![cboxHST].Value = "Invoice Hold"))
'    Set objCond = TargetForm.[cboxHST].FormatConditions.Add(acExpression, , (TargetForm![cboxHST].Value = "Billed"))
'    Set objCond = TargetForm.[cboxHST].FormatConditions.Add(acExpression, , (TargetForm![cboxHST].Value = "Contested"))
'    Set objCond = TargetForm.[cboxHST].FormatConditions.Add(acExpression, , (TargetForm![cboxHST].Value = "Re-Invoiced"))
'    Set objCond = TargetForm.[cboxHST].FormatConditions.Add(acExpression, , (TargetForm![cboxHST].Value = "Paid"))
End Sub

But as you see I had to comment them out as their syntax is incorrect and they constantly give errors.

I did find the code:
Code:
      Function GetLineNumber(f As Form, KeyName As String, KeyValue)
         Dim rs As Recordset
         Dim CountLines

         On Error GoTo Err_GetLineNumber

         Set rs = f.RecordsetClone

         ' Find the current record.
         Select Case rs.Fields(KeyName).Type
            ' Find using numeric data type key value?
            Case DB_INTEGER, DB_LONG, DB_CURRENCY, DB_SINGLE, _
            DB_DOUBLE, DB_BYTE
               rs.FindFirst "[" & KeyName & "] = " & KeyValue
            ' Find using date data type key value?
            Case DB_DATE
               rs.FindFirst "[" & KeyName & "] = #" & KeyValue & "#"
            ' Find using text data type key value?
            Case DB_TEXT
               rs.FindFirst "[" & KeyName & "] = '" & KeyValue & "'"
            Case Else
               MsgBox "ERROR: Invalid key field data type!"
               Exit Function
         End Select

         ' Loop backward, counting the lines.
         Do Until rs.BOF
            CountLines = CountLines + 1
            rs.MovePrevious
         Loop

Bye_GetLineNumber:
         ' Return the result.
         GetLineNumber = CountLines

         Exit Function

Err_GetLineNumber:
         CountLines = 0
         Resume Bye_GetLineNumber

      End Function

from File3 interesting as it what I knew is needed to track the ROWindex for each row in the continuous form, but still tryng to figure out the exact application.

I also saw some this forum thread:

http://www.mdbmakers.com/forums/showthread.php?t=20445

discussing this and the one guy, who liked concise code, stripped this down to about 3 lines of active code.

Anyway I now have two forms that need this, so really hunting for it. May have to open Fields on my main form, and assign/save values from their, if I can not get the comboboxes working right. Kinda under pressure as I have to deliver at least one of my forms in the morning.

OMR

Reply With Quote
Reply

Viewing: Tutorialized ForumsDatabasesMS Access > Data Row Problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek