Click on a field in Form A to bring up record in Form B

G

Guest

I have a form, and I would like to be able to double click on a field within
that form and open a single record corresponding to the entry in that field.

example: computer form with relevant information including an employee
number field. Double click on employee number and that employee's record
comes up from another form (Employee).

Computer Information form
Employee form

thank you!!
 
G

Guest

In the dblClick event, use the OpenForm action in a macro. Create a macro and
choose OpenForm as the action. Below, specify the form name (Employee). In
the Where Condition property, put:
[Employee] = Forms![Computer Information]!Employee

This will set a filter on the Employee form.

Barry
 
G

Guest

Thank you very much Barry for the expression. Now, I need to understand it.
What are the '!' s used for in this expression?

[Employee] = Forms![Computer Information]!Employee

thanx again

Barry Gilbert said:
In the dblClick event, use the OpenForm action in a macro. Create a macro and
choose OpenForm as the action. Below, specify the form name (Employee). In
the Where Condition property, put:
[Employee] = Forms![Computer Information]!Employee

This will set a filter on the Employee form.

Barry


bal_sagoth said:
I have a form, and I would like to be able to double click on a field within
that form and open a single record corresponding to the entry in that field.

example: computer form with relevant information including an employee
number field. Double click on employee number and that employee's record
comes up from another form (Employee).

Computer Information form
Employee form

thank you!!
 
G

Guest

'!'s (called bangs) are a way of navigating the Access object model. For
example, Forms![Computer Information] means "find a form called Computer
Information in the collection of forms in this database". Forms![Computer
Information]!Employee means "find an control (textbox, combobox, etc.) in the
form called [Computer Information] in the collection of forms in this
database." In Access you can drill down many levels, down to the properties
of an object. For example, you could refer to Forms![Computer
Information]!Employee.Visible to read whether or not that textbox is visible
as determined by its Visible property on the Format tab.

!'s allow you to navigate Access objects and .'s (periods) allow you to get
an object's property.

Barry


bal_sagoth said:
Thank you very much Barry for the expression. Now, I need to understand it.
What are the '!' s used for in this expression?

[Employee] = Forms![Computer Information]!Employee

thanx again

Barry Gilbert said:
In the dblClick event, use the OpenForm action in a macro. Create a macro and
choose OpenForm as the action. Below, specify the form name (Employee). In
the Where Condition property, put:
[Employee] = Forms![Computer Information]!Employee

This will set a filter on the Employee form.

Barry


bal_sagoth said:
I have a form, and I would like to be able to double click on a field within
that form and open a single record corresponding to the entry in that field.

example: computer form with relevant information including an employee
number field. Double click on employee number and that employee's record
comes up from another form (Employee).

Computer Information form
Employee form

thank you!!
 
G

Guest

Hi,
I have a similar form - the main form has a subform. I would like to be
able to click on a client in the subform to bring up the clients information.
I created a macro as you suggested; though missed the double click event(?)
Where is that option located? I created a macro to open the form and then
entered the field to return
[orderid]=Forms![order subform3]!orderid (entered in the Where condition
property).
I created a command button to run the macro and it displays a screen
requesting the orderid number - when that is entered it brings up the client
detail screen.

I would like to be able to double click within the subform on the client to
bring up the client information.
How can I make this work?
Thank you....Beth

Barry Gilbert said:
In the dblClick event, use the OpenForm action in a macro. Create a macro and
choose OpenForm as the action. Below, specify the form name (Employee). In
the Where Condition property, put:
[Employee] = Forms![Computer Information]!Employee

This will set a filter on the Employee form.

Barry


bal_sagoth said:
I have a form, and I would like to be able to double click on a field within
that form and open a single record corresponding to the entry in that field.

example: computer form with relevant information including an employee
number field. Double click on employee number and that employee's record
comes up from another form (Employee).

Computer Information form
Employee form

thank you!!
 
G

Guest

Select the orderId control in your subform and bring up the property sheet
(F4) if it's not already there. On the Event tab, find the On Dbl Click
event. Type in the name of your macro. Double clicking on the order id should
run your macro.

Barry
 
G

Guest

Thanks Barry - the macro is still asking for a parameter (?). When I plugged
in the orderId it brings up the screen I want to view, but why is it not
taking the value I double clicked on? Does that make sense???
Beth

Barry Gilbert said:
Select the orderId control in your subform and bring up the property sheet
(F4) if it's not already there. On the Event tab, find the On Dbl Click
event. Type in the name of your macro. Double clicking on the order id should
run your macro.

Barry

ELevesque said:
Hi,
I have a similar form - the main form has a subform. I would like to be
able to click on a client in the subform to bring up the clients information.
I created a macro as you suggested; though missed the double click event(?)
Where is that option located? I created a macro to open the form and then
entered the field to return
[orderid]=Forms![order subform3]!orderid (entered in the Where condition
property).
I created a command button to run the macro and it displays a screen
requesting the orderid number - when that is entered it brings up the client
detail screen.

I would like to be able to double click within the subform on the client to
bring up the client information.
How can I make this work?
Thank you....Beth
 
G

Guest

Is orderid the name of the field or control on the subform? This is what the
expression is pointing to. If Access cannot find the field or control, it
will prompt you.

Barry

ELevesque said:
Thanks Barry - the macro is still asking for a parameter (?). When I plugged
in the orderId it brings up the screen I want to view, but why is it not
taking the value I double clicked on? Does that make sense???
Beth

Barry Gilbert said:
Select the orderId control in your subform and bring up the property sheet
(F4) if it's not already there. On the Event tab, find the On Dbl Click
event. Type in the name of your macro. Double clicking on the order id should
run your macro.

Barry

ELevesque said:
Hi,
I have a similar form - the main form has a subform. I would like to be
able to click on a client in the subform to bring up the clients information.
I created a macro as you suggested; though missed the double click event(?)
Where is that option located? I created a macro to open the form and then
entered the field to return
[orderid]=Forms![order subform3]!orderid (entered in the Where condition
property).
I created a command button to run the macro and it displays a screen
requesting the orderid number - when that is entered it brings up the client
detail screen.

I would like to be able to double click within the subform on the client to
bring up the client information.
How can I make this work?
Thank you....Beth
 
G

Guest

OrderId is the name of a field in the subform.
Beth

Barry Gilbert said:
Is orderid the name of the field or control on the subform? This is what the
expression is pointing to. If Access cannot find the field or control, it
will prompt you.

Barry

ELevesque said:
Thanks Barry - the macro is still asking for a parameter (?). When I plugged
in the orderId it brings up the screen I want to view, but why is it not
taking the value I double clicked on? Does that make sense???
Beth

Barry Gilbert said:
Select the orderId control in your subform and bring up the property sheet
(F4) if it's not already there. On the Event tab, find the On Dbl Click
event. Type in the name of your macro. Double clicking on the order id should
run your macro.

Barry

:

Hi,
I have a similar form - the main form has a subform. I would like to be
able to click on a client in the subform to bring up the clients information.
I created a macro as you suggested; though missed the double click event(?)
Where is that option located? I created a macro to open the form and then
entered the field to return
[orderid]=Forms![order subform3]!orderid (entered in the Where condition
property).
I created a command button to run the macro and it displays a screen
requesting the orderid number - when that is entered it brings up the client
detail screen.

I would like to be able to double click within the subform on the client to
bring up the client information.
How can I make this work?
Thank you....Beth
 

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