Form.show and form.hide

D

DanRoy

I wish to develop a forms driven appliation. The top level form has a Label
field that identifies an action. When clicked, I want another form to show.
The 2nd form has a list box, preloaded with 10 values, 1-10. When the user
selects a value, a loop is entered which opens the openfile dialog that nuber
of times and save the filepath and file same to a table.
Using the top form.labelX_click event, I have experimented with:
Me![MySecondForm].Visible = True and
DoCmd.OpenForm "MySecondForm", acFormDS

The first choice produces an error when run and the second
does not open the form, but instead uses the initial selection on the
listbox and open the table where the filepath data is to be saved. What I
would like this action to do is merely display the form so it is ready for
the user to make his selections. I would like the event on the 2nd
form(activated by making a selction in the listbox) to control loading the
table, which it did before I linked the 2 forms together
 
D

Dirk Goldgar

DanRoy said:
I wish to develop a forms driven appliation. The top level form has a
Label
field that identifies an action. When clicked, I want another form to
show.
The 2nd form has a list box, preloaded with 10 values, 1-10. When the
user
selects a value, a loop is entered which opens the openfile dialog that
nuber
of times and save the filepath and file same to a table.
Using the top form.labelX_click event, I have experimented with:
Me![MySecondForm].Visible = True and
DoCmd.OpenForm "MySecondForm", acFormDS

The first choice produces an error when run and the second
does not open the form, but instead uses the initial selection on the
listbox and open the table where the filepath data is to be saved. What I
would like this action to do is merely display the form so it is ready for
the user to make his selections. I would like the event on the 2nd
form(activated by making a selction in the listbox) to control loading the
table, which it did before I linked the 2 forms together


I don't understand what you're trying to do, nor exactly what's going wrong.
Your first approach,
Me![MySecondForm].Visible = True

.... won't work if the form isn't already open. Your second approach,
DoCmd.OpenForm "MySecondForm", acFormDS

.... should open "MySecondForm", but in datasheet view. *Maybe* all you need
to do is open it in form view, which you can do like this:

DoCmd.OpenForm "MySecondForm"

Does that solve your problem?
 
D

DanRoy

Yes. Your answer is exactly what I needed. Thank you.

Dirk Goldgar said:
DanRoy said:
I wish to develop a forms driven appliation. The top level form has a
Label
field that identifies an action. When clicked, I want another form to
show.
The 2nd form has a list box, preloaded with 10 values, 1-10. When the
user
selects a value, a loop is entered which opens the openfile dialog that
nuber
of times and save the filepath and file same to a table.
Using the top form.labelX_click event, I have experimented with:
Me![MySecondForm].Visible = True and
DoCmd.OpenForm "MySecondForm", acFormDS

The first choice produces an error when run and the second
does not open the form, but instead uses the initial selection on the
listbox and open the table where the filepath data is to be saved. What I
would like this action to do is merely display the form so it is ready for
the user to make his selections. I would like the event on the 2nd
form(activated by making a selction in the listbox) to control loading the
table, which it did before I linked the 2 forms together


I don't understand what you're trying to do, nor exactly what's going wrong.
Your first approach,
Me![MySecondForm].Visible = True

... won't work if the form isn't already open. Your second approach,
DoCmd.OpenForm "MySecondForm", acFormDS

... should open "MySecondForm", but in datasheet view. *Maybe* all you need
to do is open it in form view, which you can do like this:

DoCmd.OpenForm "MySecondForm"

Does that solve your problem?

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
Top