Interchanging values between two text boxes

I

Imran Ghani

Hi! Im building my application with Access 2007 and VBA. I want to have two
text boxes with, maybe datasheet views. I want to have two command buttons;
One add button to add the values and one remove button to sent the values
back to the original text box. I'd be much appreciating your kind guidance.
Thanks in advance.
 
B

Brendan Reynolds

Imran Ghani said:
Hi! Im building my application with Access 2007 and VBA. I want to have
two
text boxes with, maybe datasheet views. I want to have two command
buttons;
One add button to add the values and one remove button to sent the values
back to the original text box. I'd be much appreciating your kind
guidance.
Thanks in advance.

Well, there are no command buttons in datasheet view, but you can place a
subform in datasheet view within a main form and place the command buttons
on the main form.

The code to add the values of two text boxes might look something like this
(I'm typing this from memory and have not tested it, so watch typos or
syntax errors on my part are possible) ...

If IsNumeric(TextBox1.Value & vbNullString) And IsNumeric(TextBox2.Value &
vbNullString) Then
TextBox3.Value = Val(TextBox1) + Val(TextBox2)
Else
MsgBox "Please enter numbers in both text boxes"
End If

I'm not sure what you mean by "send the values back to the original text
box"? Send which value to which text box?
 
I

Imran Ghani

Thanks for your kind guidance. Sorry, I couldn't make my point clear;
actually, I want to have, I might think two datasheet forms, one being
populated with the original set of values and the other one empty , both of
them being side by side. In between, there may be two command buttons; one to
add the values from left to right form and the other one that will do the
reverse. I mean when one value is added from left form to the right one, then
that value should be deleted from the left one and vice versa. I hope I might
have made myself more clear now. I'd appreciate much for your kind guidance
in this respect.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top