can someone give some basic code help??

  • Thread starter Thread starter VTTW
  • Start date Start date
V

VTTW

Guest
Can someone give me some help with (an embarassingly easy) code?

I'm familiar with the .show & .hide when used in Excel VBE, but what's the equivelant in VB6?

I want to open "form B" from "form A", then close "form B" & go back to "form A". Would show & hide be correct?

Thanks for the help,
Mark
 
If your just want to open form B as a hidden form and get info from it, use the code below (I'll just store info from "Field1" in a variable):

Dim NeededInfo as String
docmd.openform "Form B", , , , , acHidden
NeededInfo = Forms![Form B]!Field1
docmd.Close acForm, "Form B"

As a side note, giving your forms names that do not have spaces will prevent the need for brackets. The 3rd line of the above code could simply be written "NeededInfo=Forms!FormB!Field1" if there was no space.
 

Users who are viewing this thread

Back
Top Bottom