Open 2nd form to selected record

G

Guest

Hello,

I need help to get started. I have created a form with a combo box to
select a record from a query. What I would like to do is once record is
selected be able to open another form to show the details from the same
query. How do I open the 2nd form based on record selected? Also once the
2nd form is opened I want to be able to edit the record if needed.

thanks,

Robin

robin
 
J

Joan Wild

Check out the OpenForm Method in help. It includes arguments you can use to
specify a where condition.

Assuming your first form includes a unique identifier for the record (eg.
ClientID)
and the second form does as well...

DoCmd.OpenForm "Name of 2nd Form", , , "[ClientID] = " & Me!ClientID
 
G

Guest

Hello,

Thank you for your quick response. I think I need a little more help. I
went to the help locator in access but had a little trouble understanding it.
The code that you sent me, where do I sert this line of code. Is this all
I insert after I modify the field name changes?

Thanks,

Robin

Joan Wild said:
Check out the OpenForm Method in help. It includes arguments you can use to
specify a where condition.

Assuming your first form includes a unique identifier for the record (eg.
ClientID)
and the second form does as well...

DoCmd.OpenForm "Name of 2nd Form", , , "[ClientID] = " & Me!ClientID

--
Joan Wild
Microsoft Access MVP
Hello,

I need help to get started. I have created a form with a combo box to
select a record from a query. What I would like to do is once record
is selected be able to open another form to show the details from the
same query. How do I open the 2nd form based on record selected?
Also once the 2nd form is opened I want to be able to edit the record
if needed.

thanks,

Robin

robin
 
J

Joan Wild

You have a form with a combobox that finds a record and displays it.

Add a command button, in the click event of this, choose [Event Procedure]
and click on the build button (...). You would put that code between the
lines.

You may also need to modify the code if your unique identifier is text and
not a number.


--
Joan Wild
Microsoft Access MVP
Hello,

Thank you for your quick response. I think I need a little more
help. I went to the help locator in access but had a little trouble
understanding it. The code that you sent me, where do I sert this
line of code. Is this all I insert after I modify the field name
changes?

Thanks,

Robin

Joan Wild said:
Check out the OpenForm Method in help. It includes arguments you
can use to specify a where condition.

Assuming your first form includes a unique identifier for the record
(eg. ClientID)
and the second form does as well...

DoCmd.OpenForm "Name of 2nd Form", , , "[ClientID] = " & Me!ClientID

--
Joan Wild
Microsoft Access MVP
Hello,

I need help to get started. I have created a form with a combo box
to select a record from a query. What I would like to do is once
record is selected be able to open another form to show the details
from the same query. How do I open the 2nd form based on record
selected? Also once the 2nd form is opened I want to be able to
edit the record if needed.

thanks,

Robin

robin
 
G

Guest

Hello,

Your last statment indicated that I may need modify the code if my identifer
is text. Guess what , it is text. How do I modify it?

Thanks,

Robin

Joan Wild said:
You have a form with a combobox that finds a record and displays it.

Add a command button, in the click event of this, choose [Event Procedure]
and click on the build button (...). You would put that code between the
lines.

You may also need to modify the code if your unique identifier is text and
not a number.


--
Joan Wild
Microsoft Access MVP
Hello,

Thank you for your quick response. I think I need a little more
help. I went to the help locator in access but had a little trouble
understanding it. The code that you sent me, where do I sert this
line of code. Is this all I insert after I modify the field name
changes?

Thanks,

Robin

Joan Wild said:
Check out the OpenForm Method in help. It includes arguments you
can use to specify a where condition.

Assuming your first form includes a unique identifier for the record
(eg. ClientID)
and the second form does as well...

DoCmd.OpenForm "Name of 2nd Form", , , "[ClientID] = " & Me!ClientID

--
Joan Wild
Microsoft Access MVP

Robin wrote:
Hello,

I need help to get started. I have created a form with a combo box
to select a record from a query. What I would like to do is once
record is selected be able to open another form to show the details
from the same query. How do I open the 2nd form based on record
selected? Also once the 2nd form is opened I want to be able to
edit the record if needed.

thanks,

Robin

robin
 
J

Joan Wild

Robin said:
Hello,

Your last statment indicated that I may need modify the code if my
identifer is text. Guess what , it is text. How do I modify it?


Ain't it always the way? :)

DoCmd.OpenForm "Name of 2nd Form", , , "[ClientID] = " & chr(34) &
Me!ClientID & chr(34)
 

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