VB School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

VB code for Access forms Rate Topic: -----

#1 Srinidhi  Icon User is offline

  • New D.I.C Head
  • Pip

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 18-August 08


Dream Kudos: 0

Share |

VB code for Access forms

Post icon  Posted 19 August 2008 - 12:19 AM

Private Sub cbolimits_Click()
Label9.Caption = Label9.Caption + cboLiability.Value + ":" + cbolimits.Value + ","



I have two combo boxes namely "cboliability" and "cbolimits" in my form.I have to display the values that
I have selected from the combo boxes in a label box seperated by commas each time
I select the values from the "liability" and "limits". I did that but when I select the same "liability"
and select another range of "limits" it should not display seperated by a comma but it should get automatically updated in the label box
where I have selected that "liability" earlier. How to do it? Say for Eg: Coffee:10-20,Tea:20-40,Juice:30-50 and again if the user selects "Tea" with range "15-30" then "Tea:20-40" should get replaced by "Tea:15-30". The result should be displayed as Coffee:10-20,Tea:15-30,Juice:30-50. And not as Coffee:10-20,Tea:20-40,Juice:30-50,Tea:15-30.
How to do it? I am using Access 2007 with VBA as back-end code.
I am having a little bit of knowledge in Access 2007 and VBA and your help will be much Appreciable.
Thank you
Was This Post Helpful? 0
  • +
  • -


#2 thava  Icon User is offline

  • D.I.C Lover
  • Icon

Reputation: 103
  • Posts: 1,223
  • Joined: 17-April 07


Dream Kudos: 150

Re: VB code for Access forms

Posted 22 August 2008 - 12:45 AM

if the sample you entered here are fixed length, but if you retrieve the values in a database it might be change
first check the length of labelstring,
if length is zero
add the string
else
then check for "liability" in the existing string
when found that using replace string option replace the current string
else
add the string

now that's all what you want little bit of logic is also there try to find out

top solve this problem use this link
vb string function help

if you still can't find the solution i will give the code for you :^:

This post has been edited by thava: 22 August 2008 - 12:50 AM

Was This Post Helpful? 0
  • +
  • -



Fast Reply

  

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users