Microsoft Access VBA Multi-dimensional array

R

reneedaudert

I need to know how to create a two dimensional array in Access that
inputs data from two text boxes and displays them all in a third text
box. Here is what I have, but it does not work:


For x = 0 To 9
sSortArray(x, 1) = TxtName.Value
sSortArray(x, 2) = txtGrade.Value
x = x + 1
Next x

For x = 0 To 9
sDisplayString = sSortArray(x, 1) & "'s Grade is " & sSortArray(x, 2)
_
& vbNewLine
Next x

txtOutPut.Value = sDisplayString
 
J

Jezebel

You should read help on For ... Next loops. (What on earth is the 'x = x +
1' doing in there?)
 
R

Rob

Jezebel said:
You should read help on For ... Next loops. (What on earth is the 'x = x +
1' doing in there?)

He probably doesn't realize that in VBA the number automatically advances.
I've coded in C a bit and you have to do that. So what's happening is the
code is only doing even numbers, I think.
 
J

Jean-Guy Marcil

(e-mail address removed) was telling us:
(e-mail address removed) nous racontait que :
I need to know how to create a two dimensional array in Access that
inputs data from two text boxes and displays them all in a third text
box. Here is what I have, but it does not work:

For future reference, "it does not work" is in fact nearly totally useless
to those trying to help, even for seemingly simple problems.
There are always so many different things that can go wrong; especially when
we take into consideration our own personal expectations...
Next time it would be more helpful to write about the expected result and
the actual result so that we can better help you.

Also, this is a Word group. I know that VBA libraries seem similar to all
Office applications, but in fact they are not. So it would be better to
address Access issues in an Access group.

Cheers

--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
R

reneedaudert

(e-mail address removed) was telling us:
(e-mail address removed) nous racontait que :


For future reference, "it does not work" is in fact nearly totally useless
to those trying to help, even for seemingly simple problems.
There are always so many different things that can go wrong; especially when
we take into consideration our own personal expectations...
Next time it would be more helpful to write about the expected result and
the actual result so that we can better help you.

Also, this is a Word group. I know that VBA libraries seem similar to all
Office applications, but in fact they are not. So it would be better to
address Access issues in an Access group.

Cheers

--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site:http://www.word.mvps.org

dang, i never realized how hostile people were in these things... hey
thanks for nothing, i figured it all out on my own...
 
J

Jezebel

You ask for help on a page one problem, you get three versions of the
answer, and you ignore them all. No wonder you have problems. Back under
your rock!
 
J

Jean-Guy Marcil

(e-mail address removed) was telling us:
(e-mail address removed) nous racontait que :

Hostile?

Since when signing off with "Cheers" is hostile?
Did you notice the first three words of my post: "For future reference"?
I was giving you advice, not being hostile.

If you cannot tell the difference between being hostile and being helpful, I
think you will have difficulty in these groups. Remember that all
participants do so of their own free will, nobody is being paid here... I
notice that your post may not give you the help you need. So I took it on my
own to try to help you next time you post so that all involved can be more
efficient.
Sorry for caring.

Good luck anyway.

(By the way, I DO know the difference between hostile and helpful/polite,
believe me, I was very far from being hostile.)

--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

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