List box to open another form

N

NDClark

I have Form (A) which has a List box. I have the List Box set up to open
Form (B). Form (B) is a sub form of a Data Sheet (C).

My problem when the data (DATE) is clicked on the List Box, it opens the
Form (B) to a new entry. I need it to open the data (DATE) I click.
 
S

Stefan Hoffmann

hi,
I have Form (A) which has a List box. I have the List Box set up to open
Form (B). Form (B) is a sub form of a Data Sheet (C).

My problem when the data (DATE) is clicked on the List Box, it opens the
Form (B) to a new entry. I need it to open the data (DATE) I click.
How do you open it? If you use DoCmd.OpenForm take a look at the
[WhereCondition] parameter.


mfG
--> stefan <--
 
N

NDClark

I have a macro active on the list box. In the where condition I have linked
the ID fields and it still ask for a ID Parameter.
I have the following in the where condition [ID]=Forms![Surgery]!ID

Is there something amiss with this code?



Stefan Hoffmann said:
hi,
I have Form (A) which has a List box. I have the List Box set up to open
Form (B). Form (B) is a sub form of a Data Sheet (C).

My problem when the data (DATE) is clicked on the List Box, it opens the
Form (B) to a new entry. I need it to open the data (DATE) I click.
How do you open it? If you use DoCmd.OpenForm take a look at the
[WhereCondition] parameter.


mfG
--> stefan <--
 
S

Stefan Hoffmann

hi,
I have a macro active on the list box. In the where condition I have linked
the ID fields and it still ask for a ID Parameter.
I have the following in the where condition [ID]=Forms![Surgery]!ID
If it asks for a parameter, then you have some kind of error, normally a
typo. Check the name of your fields.


mfG
--> stefan <--
 
N

NDClark

When I click the data in the list box, it does open the correct form. It
just will not open the form to the correct entry.

Stefan Hoffmann said:
hi,
I have a macro active on the list box. In the where condition I have linked
the ID fields and it still ask for a ID Parameter.
I have the following in the where condition [ID]=Forms![Surgery]!ID
If it asks for a parameter, then you have some kind of error, normally a
typo. Check the name of your fields.


mfG
--> stefan <--
 
L

Larry Linson

NDClark said:
When I click the data in the list box, it does open the correct
form. It just will not open the form to the correct entry.

Then, you can assume that it is not the name of the form in which you made a
typographical error, so you can check other possibilites. The
WhereCondition argument, by the way, does not determine the Form that is
opened, only matches a Field in the Form's Record Source to a value you
supply.

Larry Linson
Microsoft Office Access MVP
Stefan Hoffmann said:
hi,
I have a macro active on the list box. In the where condition I have
linked
the ID fields and it still ask for a ID Parameter.
I have the following in the where condition [ID]=Forms![Surgery]!ID
If it asks for a parameter, then you have some kind of error, normally a
typo. Check the name of your fields.


mfG
--> stefan <--
 
N

NDClark

Hi Larry, yes, I understand what you said. However, my issue is, the form is
opening to NEW. I want to be able to click the entry in the list box and
open the entry to edit it.

Larry Linson said:
NDClark said:
When I click the data in the list box, it does open the correct
form. It just will not open the form to the correct entry.

Then, you can assume that it is not the name of the form in which you made a
typographical error, so you can check other possibilites. The
WhereCondition argument, by the way, does not determine the Form that is
opened, only matches a Field in the Form's Record Source to a value you
supply.

Larry Linson
Microsoft Office Access MVP
Stefan Hoffmann said:
hi,

NDClark wrote:
I have a macro active on the list box. In the where condition I have
linked
the ID fields and it still ask for a ID Parameter.
I have the following in the where condition [ID]=Forms![Surgery]!ID
If it asks for a parameter, then you have some kind of error, normally a
typo. Check the name of your fields.


mfG
--> stefan <--
 
S

Stefan Hoffmann

hi,
Hi Larry, yes, I understand what you said. However, my issue is, the form is
opening to NEW. I want to be able to click the entry in the list box and
open the entry to edit it.
Set the "Data Mode" to "Edit".


mfG
--> stefan <--
 

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