Macro or Command

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need some assistance in created either a macro or command. I have a form
(Classes) that contains information about particular classes including "class
name" and "class date". I have created another form (Class Search) with a
selection list that shows all the classes with their dates.

What I need is to be able to double-click on a particular class shown on the
"Class Search" form (from the selection list) and have it go directly to that
record within the "Classes" form containing all the class information.

Can anyone help? Any assistance would be greatly appreaciated.
 
Randy,

You can use an OpenForm macro for this. I assume you have a prinmary
key field for your Classes such as a ClassID or some such? So in the
Where Condition argument of the OpenForm macro action, put the equivalnt
of this...
[ClassID]=[Forms]![Class Search]![ClassID]

Another way to achieve this, assuming that the Class Search form will
stay open, is to make a query based on your Classes table, and enter the
equivalent of this in the criteria of the ClassID column in the query...
[Forms]![Class Search]![ClassID]
.... and then use this query as the Record Source for the Classes form.
In that case, all you need for your macro on the double-click event on
the control on the Class Search form is an OpenForm action with no Where
Condition required. Or if the Classes form is already open, you could
use a macro with a SelectObject action.
 
Steve...Thank you for your assistance. Everything seems to work ok except
when I double click on my selection list it does oprn the classes form but
goes to the first record rather than going to the record I double clicked on
in the selection form. It seems that no matter where I click on my selection
list, it goes to the first record. Any suggestions?
--
Randy Street
Rancho Cucamonga, CA


Steve Schapel said:
Randy,

You can use an OpenForm macro for this. I assume you have a prinmary
key field for your Classes such as a ClassID or some such? So in the
Where Condition argument of the OpenForm macro action, put the equivalnt
of this...
[ClassID]=[Forms]![Class Search]![ClassID]

Another way to achieve this, assuming that the Class Search form will
stay open, is to make a query based on your Classes table, and enter the
equivalent of this in the criteria of the ClassID column in the query...
[Forms]![Class Search]![ClassID]
.... and then use this query as the Record Source for the Classes form.
In that case, all you need for your macro on the double-click event on
the control on the Class Search form is an OpenForm action with no Where
Condition required. Or if the Classes form is already open, you could
use a macro with a SelectObject action.

--
Steve Schapel, Microsoft Access MVP

I need some assistance in created either a macro or command. I have a form
(Classes) that contains information about particular classes including "class
name" and "class date". I have created another form (Class Search) with a
selection list that shows all the classes with their dates.

What I need is to be able to double-click on a particular class shown on the
"Class Search" form (from the selection list) and have it go directly to that
record within the "Classes" form containing all the class information.

Can anyone help? Any assistance would be greatly appreaciated.
 
both of Steve's solutions will return a recordset with only the pertinent
record in it. sounds like your form is opening with multiple records. which
solution did you use? and how did you set it up?


Randy said:
Steve...Thank you for your assistance. Everything seems to work ok except
when I double click on my selection list it does oprn the classes form but
goes to the first record rather than going to the record I double clicked on
in the selection form. It seems that no matter where I click on my selection
list, it goes to the first record. Any suggestions?
--
Randy Street
Rancho Cucamonga, CA


Steve Schapel said:
Randy,

You can use an OpenForm macro for this. I assume you have a prinmary
key field for your Classes such as a ClassID or some such? So in the
Where Condition argument of the OpenForm macro action, put the equivalnt
of this...
[ClassID]=[Forms]![Class Search]![ClassID]

Another way to achieve this, assuming that the Class Search form will
stay open, is to make a query based on your Classes table, and enter the
equivalent of this in the criteria of the ClassID column in the query...
[Forms]![Class Search]![ClassID]
.... and then use this query as the Record Source for the Classes form.
In that case, all you need for your macro on the double-click event on
the control on the Class Search form is an OpenForm action with no Where
Condition required. Or if the Classes form is already open, you could
use a macro with a SelectObject action.

--
Steve Schapel, Microsoft Access MVP

I need some assistance in created either a macro or command. I have a form
(Classes) that contains information about particular classes including "class
name" and "class date". I have created another form (Class Search) with a
selection list that shows all the classes with their dates.

What I need is to be able to double-click on a particular class shown on the
"Class Search" form (from the selection list) and have it go directly to that
record within the "Classes" form containing all the class information.

Can anyone help? Any assistance would be greatly appreaciated.
 
Hi Tina...Thank you for your response. I have actually tried both methods. If
I use the formula within the OpenForm macro I get the first record always, no
matter which record I double click on in my selection list.

If I use the query method with the formula within the query I get a blank
record when double clicking a record on the selection list.

I am stumped!
--
Randy Street
Rancho Cucamonga, CA


tina said:
both of Steve's solutions will return a recordset with only the pertinent
record in it. sounds like your form is opening with multiple records. which
solution did you use? and how did you set it up?


Randy said:
Steve...Thank you for your assistance. Everything seems to work ok except
when I double click on my selection list it does oprn the classes form but
goes to the first record rather than going to the record I double clicked on
in the selection form. It seems that no matter where I click on my selection
list, it goes to the first record. Any suggestions?
--
Randy Street
Rancho Cucamonga, CA


Steve Schapel said:
Randy,

You can use an OpenForm macro for this. I assume you have a prinmary
key field for your Classes such as a ClassID or some such? So in the
Where Condition argument of the OpenForm macro action, put the equivalnt
of this...
[ClassID]=[Forms]![Class Search]![ClassID]

Another way to achieve this, assuming that the Class Search form will
stay open, is to make a query based on your Classes table, and enter the
equivalent of this in the criteria of the ClassID column in the query...
[Forms]![Class Search]![ClassID]
.... and then use this query as the Record Source for the Classes form.
In that case, all you need for your macro on the double-click event on
the control on the Class Search form is an OpenForm action with no Where
Condition required. Or if the Classes form is already open, you could
use a macro with a SelectObject action.

--
Steve Schapel, Microsoft Access MVP


Randy wrote:
I need some assistance in created either a macro or command. I have a form
(Classes) that contains information about particular classes including "class
name" and "class date". I have created another form (Class Search) with a
selection list that shows all the classes with their dates.

What I need is to be able to double-click on a particular class shown on the
"Class Search" form (from the selection list) and have it go directly to that
record within the "Classes" form containing all the class information.

Can anyone help? Any assistance would be greatly appreaciated.
 
btw, hi, neighbor! <g>

okay, we need some basic info. are the selection list and the Classes list
based on the same table? what's the name of the primary key field?

is the selection list a listbox or combo box on the ClassSearch form? if so,
what's the name of the control?

post the code from your test of the "formula within the OpenForm macro."


Randy said:
Hi Tina...Thank you for your response. I have actually tried both methods. If
I use the formula within the OpenForm macro I get the first record always, no
matter which record I double click on in my selection list.

If I use the query method with the formula within the query I get a blank
record when double clicking a record on the selection list.

I am stumped!
--
Randy Street
Rancho Cucamonga, CA


tina said:
both of Steve's solutions will return a recordset with only the pertinent
record in it. sounds like your form is opening with multiple records. which
solution did you use? and how did you set it up?


Randy said:
Steve...Thank you for your assistance. Everything seems to work ok except
when I double click on my selection list it does oprn the classes form but
goes to the first record rather than going to the record I double
clicked
on
in the selection form. It seems that no matter where I click on my selection
list, it goes to the first record. Any suggestions?
--
Randy Street
Rancho Cucamonga, CA


:

Randy,

You can use an OpenForm macro for this. I assume you have a prinmary
key field for your Classes such as a ClassID or some such? So in the
Where Condition argument of the OpenForm macro action, put the equivalnt
of this...
[ClassID]=[Forms]![Class Search]![ClassID]

Another way to achieve this, assuming that the Class Search form will
stay open, is to make a query based on your Classes table, and enter the
equivalent of this in the criteria of the ClassID column in the query...
[Forms]![Class Search]![ClassID]
.... and then use this query as the Record Source for the Classes form.
In that case, all you need for your macro on the double-click event on
the control on the Class Search form is an OpenForm action with no Where
Condition required. Or if the Classes form is already open, you could
use a macro with a SelectObject action.

--
Steve Schapel, Microsoft Access MVP


Randy wrote:
I need some assistance in created either a macro or command. I
have a
form
(Classes) that contains information about particular classes
including
"class
name" and "class date". I have created another form (Class Search) with a
selection list that shows all the classes with their dates.

What I need is to be able to double-click on a particular class
shown
on the
"Class Search" form (from the selection list) and have it go
directly
to that
record within the "Classes" form containing all the class information.

Can anyone help? Any assistance would be greatly appreaciated.
 
Back
Top