Please help VBA Newbe with second project ever.

Please help VBA Newbe with second project ever.

mid-awe
Collaborator Collaborator
1,082 Views
24 Replies
Message 1 of 25

Please help VBA Newbe with second project ever.

mid-awe
Collaborator
Collaborator
Hey all,

I'm struggling with learning the most basic VBA concepts. I know how to program from my experience with LISP and the old BASIC so the handling of variables and stuff is easy for me but I need to know how to get the user's input from a text box and store it as a variable that I'll show in the dialogue in a label. I have labels 1 through 119 and I'll increment the numbers as data is entered by a control button. Now when this button is clicked or enter is pressed on the keyboard I'd like to get the value or whatever it's called from the textbox and assign that value to the appropriate label.

Can anyone please help. Thanks in advance.
0 Likes
1,083 Views
24 Replies
Replies (24)
Message 21 of 25

mid-awe
Collaborator
Collaborator
I agree, and thanks for the advice.

If you are interested: below I've attached a screen shot of the dialogue.
0 Likes
Message 22 of 25

mid-awe
Collaborator
Collaborator
OK, so I found out the problem. The labels only accept the new value if they have the 0, as your example does, to begin with. It must be a VBA thing. Can I start out with no value, just blank or will it have to have the zero?

Thanks
0 Likes
Message 23 of 25

Anonymous
Not applicable
Hi,

Having finally devised what you are trying to do have a look at this very
rough interface.

You could also add a Disk selection control if relevant.
It will allow you to get user input with no typing and you can put data of
files to print in the right combobox - keeping the data sorted, so the user
can see what he is getting - also refusing to allow duplicates.

Populate the left box with drawing files in the selected directory.

The Add button would add a file from the left column into the right column
in sorted order and remove it form the left column so your user can also see
which files he is not printing. The remove button does the opposite.

Also note the file size of the screen grab I've posted cf yours.

You should always post screen grabs as PNG files.


--

Laurie Comerford
CADApps
www.cadapps.com.au
wrote in message news:[email protected]...
I agree, and thanks for the advice.

If you are interested: below I've attached a screen shot of the dialogue.
0 Likes
Message 24 of 25

Anonymous
Not applicable
If you don't have a value the adding portion fails. Don't
know what your doing, you might not need to add the
values up at. You could wrap that section to check the
value of the current label

If (urLabel.Caption) <> "" Then
urLabel = CDbl(TextBox1) + CDbl(urLabel.Caption)
Else:
urLabel = TextBox1
End If

wrote in message news:[email protected]...
OK, so I found out the problem. The labels only accept the new value if they
have the 0, as your example does, to begin with. It must be a VBA thing. Can
I start out with no value, just blank or will it have to have the zero?

Thanks
0 Likes
Message 25 of 25

mid-awe
Collaborator
Collaborator
Thank you. I never posted a screenshot here before and thought that .bmp was the safest bet. I prefer .png files any day.
0 Likes