Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo box options assigned ONLY to one record ?

Status
Not open for further replies.

lebanoncedars

Programmer
Jul 17, 2002
43
CA
Hi guys,
Any one knows how to assign an option action to one record ONLY at the time.

I have: Continous form Called "Customer datasheet"
Combo Box Called "Sattus" and has four options in it:
- Dispatched
- Pickup Up
- Cleared
- to be Invoiced

and one text field Called "tex0"

I need when I click on one of the record on my continous form "Customer datasheet" and choose the option in my combo box "Status", I want "text0" field to change color and name.
It means the names are the options in my combo box.
and the colors is located in the code I create.
Yake a look at it:

Private Sub Status_Click()

Status.ForeColor = vbBlack
text0.ForeColor = vbVlack ' text0 is the text field name
text0 = Status 'Status is the combo box name

Select Case Me.Status
Case "Dispatched" 'Order dispatched
text0.BackColor = vbRed
text0.ForeColor = vbBlack
Me.text0 = "Dispatched"
Case "Picked Up" 'Order Picked Up
text0.BackColor = vbGreen
text0.ForeColor = vbBlack
Me.text0 = "Picked Up"
Case "Cleared" 'Order cleared
text0.BackColor = vbCyan
text0.ForeColor = vbBlack
Me.text0 = "Cleared"
Case "to be Invoiced" 'Order to be invoiced
text0.BackColor = vbBlue
text0.ForeColor = vbBlack
Me.text0 = "to be Invoiced"

Case Else
Status.ForeColor = vbWhite
text0.ForeColor = vbWhite
End Select

End Sub

I need help Please with that.
The problem is now the color is applying on the column of the text field name "text0" in all the records in my continous form instead changing ONLY the color on "text0" in one record. and the ONLY record I choose to change.

THanks
lebanoncedars
 
Hi
Which version od Access are you using?

In versions before A2000, you cannot do what you are trying to do.

In versions A2000, and A2002 (XP) there is an option called 'Conditional Formatting'm which I believe will allow you to do what you are trying to do, but I have not used it and cannot give step by step instructions, I suggest a search for 'conditional formatting' in help? Hope this helps

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
kenneth.reaySPAMNOT@talk21.com
remove SPAMNOT to use
 
Hi kenreay,
I'm really surprised!
The company I worked for has an NT 4.0 and access 97. I saw it there and its working fine with them, I even tried it out to see how does it work.
That's what is really surprising me.
So I'm trying to do the same idea.

When I click one record at the side, I click on the combo choice. The color and the choice name located in the combo box changes the text field "text0" to whatever in the combo box.
I don't know really much about conditional format and Vb, so I thought maybe someone would know a code to impliment it with the code mentioned above, so I can apply that to one record at the time or to that (customer ID).

Well thanks anyway.
if U find that code let me know.
Lebanoncedars
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top