How do I set record on one form based another form

F

Flick Olmsford

I need to know how to set a record on one form based user selection in
another form. We are using Access 2003.

I have formA - the main form for data management. Records in db are tied
together by Client ID field

On form A we click a command button to bring up FormB.

On FormB User enters first and last name and a comand buttion runs a query
that displays possible matches in a list box on FormB. If the desired
clients name appears in the list box, I want the user to be able to select it
and then close FormB with the selected client displayed for view / editing on
FormA

I have tried and tried and tried but cannot get anything to work.

Thank you.
 
P

PJFry

First, select an event to run the code. Personally I would use an On Double
Click in the list box. Then the user just needs to double click on the name
of the person they want. Then use this code:

DoCmd.OpenForm "FormA", acNormal, , "txtName = '" & lstName & "'"
DoCmd.Close acForm, "FormB"

txtName is what ever the name that you want the form to open with. lstName
is the list box.

Let me know if this does not work.
 
P

PJFry

Flick Olmsford said:
I need to know how to set a record on one form based user selection in
another form. We are using Access 2003.

I have formA - the main form for data management. Records in db are tied
together by Client ID field

On form A we click a command button to bring up FormB.

On FormB User enters first and last name and a comand buttion runs a query
that displays possible matches in a list box on FormB. If the desired
clients name appears in the list box, I want the user to be able to select it
and then close FormB with the selected client displayed for view / editing on
FormA

I have tried and tried and tried but cannot get anything to work.

Thank you.
 
J

Jan Baird

Jan Baird is out of the country until September 20. Every effort will be
made to respond to messages, but please be patient.
 
J

Jan Baird

Jan Baird is out of the country until September 20. Every effort will be
made to respond to messages, but please be patient.
 
J

Jan Baird

Jan Baird is out of the country until September 20. Every effort will be
made to respond to messages, but please be patient.
 

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