Welcome to Dream.In.Code
Getting VB Help is Easy!

Join 136,552 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,898 people online right now. Registration is fast and FREE... Join Now!




VB code for Access forms

 
Reply to this topicStart new topic

VB code for Access forms

Srinidhi
19 Aug, 2008 - 12:19 AM
Post #1

New D.I.C Head
*

Joined: 18 Aug, 2008
Posts: 1

CODE
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

User is offlineProfile CardPM
+Quote Post

thava
RE: VB Code For Access Forms
22 Aug, 2008 - 12:45 AM
Post #2

D.I.C Regular
Group Icon

Joined: 17 Apr, 2007
Posts: 450



Thanked: 18 times
Dream Kudos: 50
My Contributions
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 icon_up.gif

This post has been edited by thava: 22 Aug, 2008 - 12:50 AM
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 11:13PM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month