Select from a combo box, go to related record in another form

G

Guest

Hi,

I've been struggling with this. It seems to be simple enough, but I cannot
get my macro to work.

I would like to have one form with just a combo box. The combo box contains
a user ID and the First/Last names, so that when a user selects from the
combo box, they are sure to select the correct person. After selecting from
the combo box, I'd like to have a different form open to the record selected
from the combo box. I'd like just that record to be displayed.

I created a macro that opens the other form (OpenForm), and input an
expression for the "Where Condition": [ID]=[Forms]![MyFormName]![ID]; this
macro was added to the "OnChange" event in the combo box properties.

When I select from the combo box, the other form opens, but it does not go
to the record selected. It goes to the a blank new record.

Where am I going wrong? I'm not a prgrammer, so VBA isn't an option. (unless
it was fairly easy to understand) :)

I've read a lot of the posted discussions and tried a few of those
suggestions out, but they don't seem to work for what I want to do. I know
this cannot be that hard. Any suggestions?
 
J

Jeff Boyce

Tammy

What purpose does having the second form serve? Why not have the form in
which the combobox sits serve as the form in which you display the "found"
record?

An unbound combobox in the header lets you pick "the correct person".

You can create a query that gets "person" data and uses, as a selection
criterion, the value of the form's combo box!

Will this get you what you need?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
G

Guest

Hi Jeff,

That is exactly what I would do - use the same form. However, I have a user
who would like the two separate forms. I am going to try and convince her to
just use the one form.

Thanks very much for responding!

Jeff Boyce said:
Tammy

What purpose does having the second form serve? Why not have the form in
which the combobox sits serve as the form in which you display the "found"
record?

An unbound combobox in the header lets you pick "the correct person".

You can create a query that gets "person" data and uses, as a selection
criterion, the value of the form's combo box!

Will this get you what you need?

Regards

Jeff Boyce
Microsoft Office/Access MVP

Tammy said:
Hi,

I've been struggling with this. It seems to be simple enough, but I cannot
get my macro to work.

I would like to have one form with just a combo box. The combo box
contains
a user ID and the First/Last names, so that when a user selects from the
combo box, they are sure to select the correct person. After selecting
from
the combo box, I'd like to have a different form open to the record
selected
from the combo box. I'd like just that record to be displayed.

I created a macro that opens the other form (OpenForm), and input an
expression for the "Where Condition": [ID]=[Forms]![MyFormName]![ID]; this
macro was added to the "OnChange" event in the combo box properties.

When I select from the combo box, the other form opens, but it does not go
to the record selected. It goes to the a blank new record.

Where am I going wrong? I'm not a prgrammer, so VBA isn't an option.
(unless
it was fairly easy to understand) :)

I've read a lot of the posted discussions and tried a few of those
suggestions out, but they don't seem to work for what I want to do. I know
this cannot be that hard. Any suggestions?
 
J

Jeff Boyce

Tammy

Perhaps you could ask the same question...

If the first form only holds a combobox, why? How does having that mostly
empty form help *her* do what she wants to do?

Regards

Jeff Boyce
Microsoft Office/Access MVP

Tammy said:
Hi Jeff,

That is exactly what I would do - use the same form. However, I have a
user
who would like the two separate forms. I am going to try and convince her
to
just use the one form.

Thanks very much for responding!

Jeff Boyce said:
Tammy

What purpose does having the second form serve? Why not have the form in
which the combobox sits serve as the form in which you display the
"found"
record?

An unbound combobox in the header lets you pick "the correct person".

You can create a query that gets "person" data and uses, as a selection
criterion, the value of the form's combo box!

Will this get you what you need?

Regards

Jeff Boyce
Microsoft Office/Access MVP

Tammy said:
Hi,

I've been struggling with this. It seems to be simple enough, but I
cannot
get my macro to work.

I would like to have one form with just a combo box. The combo box
contains
a user ID and the First/Last names, so that when a user selects from
the
combo box, they are sure to select the correct person. After selecting
from
the combo box, I'd like to have a different form open to the record
selected
from the combo box. I'd like just that record to be displayed.

I created a macro that opens the other form (OpenForm), and input an
expression for the "Where Condition": [ID]=[Forms]![MyFormName]![ID];
this
macro was added to the "OnChange" event in the combo box properties.

When I select from the combo box, the other form opens, but it does not
go
to the record selected. It goes to the a blank new record.

Where am I going wrong? I'm not a prgrammer, so VBA isn't an option.
(unless
it was fairly easy to understand) :)

I've read a lot of the posted discussions and tried a few of those
suggestions out, but they don't seem to work for what I want to do. I
know
this cannot be that hard. Any suggestions?
 
G

Guest

Thanks, again, Jeff. I've added the combo box to the header section of the
form and it works great. Have forwarded it to my user, so we'll see if she is
happy with it. Thanks for responding so quickly.

Jeff Boyce said:
Tammy

Perhaps you could ask the same question...

If the first form only holds a combobox, why? How does having that mostly
empty form help *her* do what she wants to do?

Regards

Jeff Boyce
Microsoft Office/Access MVP

Tammy said:
Hi Jeff,

That is exactly what I would do - use the same form. However, I have a
user
who would like the two separate forms. I am going to try and convince her
to
just use the one form.

Thanks very much for responding!

Jeff Boyce said:
Tammy

What purpose does having the second form serve? Why not have the form in
which the combobox sits serve as the form in which you display the
"found"
record?

An unbound combobox in the header lets you pick "the correct person".

You can create a query that gets "person" data and uses, as a selection
criterion, the value of the form's combo box!

Will this get you what you need?

Regards

Jeff Boyce
Microsoft Office/Access MVP

Hi,

I've been struggling with this. It seems to be simple enough, but I
cannot
get my macro to work.

I would like to have one form with just a combo box. The combo box
contains
a user ID and the First/Last names, so that when a user selects from
the
combo box, they are sure to select the correct person. After selecting
from
the combo box, I'd like to have a different form open to the record
selected
from the combo box. I'd like just that record to be displayed.

I created a macro that opens the other form (OpenForm), and input an
expression for the "Where Condition": [ID]=[Forms]![MyFormName]![ID];
this
macro was added to the "OnChange" event in the combo box properties.

When I select from the combo box, the other form opens, but it does not
go
to the record selected. It goes to the a blank new record.

Where am I going wrong? I'm not a prgrammer, so VBA isn't an option.
(unless
it was fairly easy to understand) :)

I've read a lot of the posted discussions and tried a few of those
suggestions out, but they don't seem to work for what I want to do. I
know
this cannot be that hard. Any suggestions?
 

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