How do I set record on one form based another form

  • Thread starter Thread starter Flick Olmsford
  • Start date Start date
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.
 
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.
 
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.
 
Jan Baird is out of the country until September 20. Every effort will be
made to respond to messages, but please be patient.
 
Jan Baird is out of the country until September 20. Every effort will be
made to respond to messages, but please be patient.
 
Jan Baird is out of the country until September 20. Every effort will be
made to respond to messages, but please be patient.
 
Back
Top