opening a form by clicking on a field from a form

  • Thread starter Thread starter Rebecca
  • Start date Start date
R

Rebecca

I have been working on this and got some help from a different newsgroup but
found this group for "macros" and thought someone here might be able to help
me out further.

I have a form (FirmInfo) and on this form there is a subform (MembersInFirm)
I want to be able to double click on the last name in the MembersInFirm form
and it opens another form named MemberFile that will automatically have the
members file information of the name that was double clicked.

The macro works and doesn't work. When I open up the subform, MembersInFirm
(which when opened is a continuous form) I double click on the last name and
it opens the MemberFile form for the last name I double clicked on.
However, if there are more than one of the last name, it opens it up the
first in alpha order. I am sure I have this in the macro somewhere but
don't know where. I need it to open the exact file for that name. I am
wondering if there is a way for you to click on the last name but the
MemberFile opens using the MemberID (which is the Primary key)?

The next problem.

I can't get the macro to work at all from inside the subform when the
FirmInfo form is open.

I do not work on VB only in design view. I am running Office XP with Access
2002, SP3.

If you need more information to help me out, please let me know.
Thanks in advance!!!!

Rebecca S.
 
your OpenForm macro must have a condition set. please post it. also the
OpenForm action must have a Filter Name or Where Condition set. please post
that also.
 
The OpenForm condition: IsNull([Forms]![membersinfirm]![LastName])

Is there a way to show you the whole macro?

Rebecca S.
 
you have to type it out, as

Macro
Name: x
Condition: x
Action: OpenForm
FormName: x
View: <blank>
FilterName: x
etc, etc, etc

the "condition" you posted doesn't make sense to me, so please post the
*entire macro*, including properties that are blank - like my View example
above. suggest you do a copy/paste of each line, rather than typing it in.
reason - you may make an error in re-typing, that doesn't exist in your
actual macro, but then i'd waste time focusing on the "fake" error.


Rebecca said:
The OpenForm condition: IsNull([Forms]![membersinfirm]![LastName])

Is there a way to show you the whole macro?

Rebecca S.

tina said:
your OpenForm macro must have a condition set. please post it. also the
OpenForm action must have a Filter Name or Where Condition set. please post
that also.


newsgroup
but to
help MembersInFirm
form have
the name
and
 
Ok.. sorry about that.. Lets try this:

Condition: IsNull([Forms]![Membersinfirm]![LastName])
Action: OpenForm
FormName: Membersinfirm
View: Form
Filter Name: x
Where Condition: x
Data Mode: Edit
Window Mode: Normal

Condition: ...
Action: Select Object
Object Type: Form
Object Name: Membersinfirm
In Database Window: no

Condition: ...
Action: Stop Macro

Condition: x
Action: Open Form
Form Name: TADC Member File
View: Form
Filter Name: x
Where Condition: [LastName]=[Forms]![TADC Member File]![LastName]
Data Mode: Read Only
Window Mode: Normal

Condition: x
Action: SelectObject
Object Type: Form
Object Name: Membersinfirm
In Database Window: No

I hope that is what you were asking for. Thank you for being so patient!

I have been working with it today and have changed some things(making it
worse!), and stupid me didn't make a copy of the original so now it is not
working even from the Membersinfirm form. It does open the TADC Member File
but it is a blank form.

Thanks in advance!!!
Rebecca S.



tina said:
you have to type it out, as

Macro
Name: x
Condition: x
Action: OpenForm
FormName: x
View: <blank>
FilterName: x
etc, etc, etc

the "condition" you posted doesn't make sense to me, so please post the
*entire macro*, including properties that are blank - like my View example
above. suggest you do a copy/paste of each line, rather than typing it in.
reason - you may make an error in re-typing, that doesn't exist in your
actual macro, but then i'd waste time focusing on the "fake" error.


Rebecca said:
The OpenForm condition: IsNull([Forms]![membersinfirm]![LastName])

Is there a way to show you the whole macro?

Rebecca S.

tina said:
your OpenForm macro must have a condition set. please post it. also the
OpenForm action must have a Filter Name or Where Condition set. please post
that also.


I have been working on this and got some help from a different newsgroup
but
found this group for "macros" and thought someone here might be able to
help
me out further.

I have a form (FirmInfo) and on this form there is a subform
(MembersInFirm)
I want to be able to double click on the last name in the MembersInFirm
form
and it opens another form named MemberFile that will automatically have
the
members file information of the name that was double clicked.

The macro works and doesn't work. When I open up the subform,
MembersInFirm
(which when opened is a continuous form) I double click on the last name
and
it opens the MemberFile form for the last name I double clicked on.
However, if there are more than one of the last name, it opens it up the
first in alpha order. I am sure I have this in the macro somewhere but
don't know where. I need it to open the exact file for that name. I am
wondering if there is a way for you to click on the last name but the
MemberFile opens using the MemberID (which is the Primary key)?

The next problem.

I can't get the macro to work at all from inside the subform when the
FirmInfo form is open.

I do not work on VB only in design view. I am running Office XP with
Access
2002, SP3.

If you need more information to help me out, please let me know.
Thanks in advance!!!!

Rebecca S.
 
okay, let's just scrap you current macro completely, rather than trying to
fix it piecemeal. i've written a new macro for you to try, using the form
and control names you used in your original post, because those made the
most sense to me. make sure you read the additional notes after the macro.

Macro
Name: opendetails
Condition: [MemberID] Is Not Null
Action: OpenForm
Form Name: MemberFile
View: Form
Filter Name: <leave it blank>
Where Condition: [MemberID] =
Forms![FirmInfo]![MembersInFirm].Form![MemberID]
Data Mode: Read Only
Window Mode: Normal

first, look at the Where Condition. the reference is forms collection
[Forms], main form ![FirmInfo], subform control ![MembersInFirm], subform's
form properties .Form, member id control in subform ![MemberID]. the subform
name you gave is MembersInForm. *the name of the subform object in the
database window may not be the same as the name of the subform **control**
in the main form's design view.* and the name of the subform control is
what we need to use. so, follow these instructions to the the correct name:
1. open the main form in design view.
2. click *once* on the subform to select it.
3. open the Properties box, if it's not already open
4. click on the Other tab.
5. look at the Name property.
in the macro Where Condition, replace the subform name with that name (from
#5 above). *note*: don't change the syntax of the expression, meaning don't
change or remove dots (.), bangs (!), or brackets [ ], or change the order
of the reference - collection, form, subform, etc.

second, substitute any other form or control names in "my" macro, so they
are correct for your database. in the Where Condition, make very sure that
any name change you make does not change the reference to a *different* form
or field than the one intended.
last, i saw that your macro had a SelectObject action in it. you shouldn't
need that at all. when you open the MemberFile form, if it doesn't open "on
top", as the active form, then change the macro's WindowMode setting to
Dialog.

hth


Rebecca said:
Ok.. sorry about that.. Lets try this:

Condition: IsNull([Forms]![Membersinfirm]![LastName])
Action: OpenForm
FormName: Membersinfirm
View: Form
Filter Name: x
Where Condition: x
Data Mode: Edit
Window Mode: Normal

Condition: ...
Action: Select Object
Object Type: Form
Object Name: Membersinfirm
In Database Window: no

Condition: ...
Action: Stop Macro

Condition: x
Action: Open Form
Form Name: TADC Member File
View: Form
Filter Name: x
Where Condition: [LastName]=[Forms]![TADC Member File]![LastName]
Data Mode: Read Only
Window Mode: Normal

Condition: x
Action: SelectObject
Object Type: Form
Object Name: Membersinfirm
In Database Window: No

I hope that is what you were asking for. Thank you for being so patient!

I have been working with it today and have changed some things(making it
worse!), and stupid me didn't make a copy of the original so now it is not
working even from the Membersinfirm form. It does open the TADC Member File
but it is a blank form.

Thanks in advance!!!
Rebecca S.



tina said:
you have to type it out, as

Macro
Name: x
Condition: x
Action: OpenForm
FormName: x
View: <blank>
FilterName: x
etc, etc, etc

the "condition" you posted doesn't make sense to me, so please post the
*entire macro*, including properties that are blank - like my View example
above. suggest you do a copy/paste of each line, rather than typing it in.
reason - you may make an error in re-typing, that doesn't exist in your
actual macro, but then i'd waste time focusing on the "fake" error.


Rebecca said:
The OpenForm condition: IsNull([Forms]![membersinfirm]![LastName])

Is there a way to show you the whole macro?

Rebecca S.

your OpenForm macro must have a condition set. please post it. also the
OpenForm action must have a Filter Name or Where Condition set. please
post
that also.


I have been working on this and got some help from a different newsgroup
but
found this group for "macros" and thought someone here might be
able
to
help
me out further.

I have a form (FirmInfo) and on this form there is a subform
(MembersInFirm)
I want to be able to double click on the last name in the MembersInFirm
form
and it opens another form named MemberFile that will automatically have
the
members file information of the name that was double clicked.

The macro works and doesn't work. When I open up the subform,
MembersInFirm
(which when opened is a continuous form) I double click on the
last
name
and
it opens the MemberFile form for the last name I double clicked on.
However, if there are more than one of the last name, it opens it
up
the
first in alpha order. I am sure I have this in the macro
somewhere
but
don't know where. I need it to open the exact file for that name.
I
 
Back
Top