Linking Forms

M

Marat Mamedov

Hello, my name is Marat Mamedov, and any help with solving
my little problem would be greatly appreciated.

I am creating data entry forms that will take in certain
people's names and certain information that needs to be
associated with that person. I currently have 2 forms. In
one for a user selects that particular name out of a list
box.

The user will then hit a command button which will that
that user to another form.

What I would like to do is have the name that was selected
in the list box from the first form, be displayed in a
text, list, or combo box in the second form.

However, the name needs to be selected (highlighted) not
just displayed.

If anyone could please help me with this once again I
would greatly appreciate it.

Thank you.
 
H

Howard Brody

In the code for your CommandButton on frmForm1, try:

Private Sub cmdGoToForm2()

' open frmForm2
DoCmd.OpenForm "frmForm2", acViewNormal

' populate name text box on frmForm2 with
' the selected name from frmForm1
[Forms]![frmForm2]![txtName] = _
[Forms]![frmForm1]![lstName]

' close ffmForm1 (if appropriate)
DoCmd.Close acForm, "frmForm1", acSaveNo

End Sub

Hope this helps!

Howard Brody
 
M

Marat Mamedov

Howard,

Thank you so much for your helped I appreciate it.

Marat
-----Original Message-----
In the code for your CommandButton on frmForm1, try:

Private Sub cmdGoToForm2()

' open frmForm2
DoCmd.OpenForm "frmForm2", acViewNormal

' populate name text box on frmForm2 with
' the selected name from frmForm1
[Forms]![frmForm2]![txtName] = _
[Forms]![frmForm1]![lstName]

' close ffmForm1 (if appropriate)
DoCmd.Close acForm, "frmForm1", acSaveNo

End Sub

Hope this helps!

Howard Brody

-----Original Message-----
Hello, my name is Marat Mamedov, and any help with solving
my little problem would be greatly appreciated.

I am creating data entry forms that will take in certain
people's names and certain information that needs to be
associated with that person. I currently have 2 forms. In
one for a user selects that particular name out of a list
box.

The user will then hit a command button which will that
that user to another form.

What I would like to do is have the name that was selected
in the list box from the first form, be displayed in a
text, list, or combo box in the second form.

However, the name needs to be selected (highlighted) not
just displayed.

If anyone could please help me with this once again I
would greatly appreciate it.

Thank you.
.
.
 

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