Howdy, just started doing some VBA with Access. I've done some Java and C/C++ so I'm not too newbie but they're some strange things here! :D
For an exercise, we have to make 2 forms in MS Access. The first form has a textbox and a command button. The second form has only a textbox. The objective is to:
- enter some value in Form1's textbox
- click the command button on Form1
- have it "set focus" onto Form2
- have the value magically appear on Form2
I'm sure this is very basic for most of you but I have some questions :D Here's my code anyway, it works but I got some help from a friend but don't fully understand it (yet)...
' Form1's Code
Private Sub Command_Click()
textBoxInForm1.SetFocus
Form_Form2.SetFocus
End Sub
' Form2's Code
Private Sub Form_Load()
textBoxInForm2.SetFocus
textBoxInForm2 = Form_Form1.textBoxInForm1.Text
End Sub
Q1) What is the whole idea behind this "SetFocus" thing?
Q2) VB doesn't require () after methods/functions?
Q3) While "Me" is not used here, I've seen it elsewhere in sample code. Is it the same as "this" in Java/C++?
Question
fault
Howdy, just started doing some VBA with Access. I've done some Java and C/C++ so I'm not too newbie but they're some strange things here! :D
For an exercise, we have to make 2 forms in MS Access. The first form has a textbox and a command button. The second form has only a textbox. The objective is to:
- enter some value in Form1's textbox
- click the command button on Form1
- have it "set focus" onto Form2
- have the value magically appear on Form2
I'm sure this is very basic for most of you but I have some questions :D Here's my code anyway, it works but I got some help from a friend but don't fully understand it (yet)...
Q1) What is the whole idea behind this "SetFocus" thing?
Q2) VB doesn't require () after methods/functions?
Q3) While "Me" is not used here, I've seen it elsewhere in sample code. Is it the same as "this" in Java/C++?
Cheers for the help.
Link to comment
Share on other sites
1 answer to this question
Recommended Posts