Form Data fields

B

Brian

I have a data base with a form that has many Combo boxes, what I would like
to do is as an entry is input have a second Data field display location
information.

Let’s make this easier, I have a table with people’s names and addresses.
On the form I have a Combo box that allows you to pick a name from the list.
What I want to do is have a box next to the name automatically display the
address after a name has been chosen. Then I will pull that information into
a Report.

Should be not too difficult, just need an example.

Thanks, Brain
 
C

Carl Rapson

Brian said:
I have a data base with a form that has many Combo boxes, what I would like
to do is as an entry is input have a second Data field display location
information.

Let's make this easier, I have a table with people's names and addresses.
On the form I have a Combo box that allows you to pick a name from the
list.
What I want to do is have a box next to the name automatically display the
address after a name has been chosen. Then I will pull that information
into
a Report.

Should be not too difficult, just need an example.

Thanks, Brain

In the AfterUpdate event of the combo box:

Me.txtAddress = DLookUp("[Address]","[myTable]","[Name]='" & Me.cboName &
"'")

Be sure to use your own control, table, and field names. In your report,
you'll need to do something similar, since unbound controls won't carry over
to a report.

Carl Rapson
 
B

Brian

In the AfterUpdate event of the combo box:

Me.txtAddress = DLookUp("[Address]","[myTable]","[Name]='" & Me.cboName &
"'")

Be sure to use your own control, table, and field names. In your report,
you'll need to do something similar, since unbound controls won't carry over
to a report.

Carl Rapson

Yes that will work, but is there a way to retain that information to then
run a report off the table that drives that form?

What I am doing is creating an "Issue-History" table from that form at the
"On Close", then pulling the History table into the printed report. The
problem I am having is that when a name is picked the location and phone
number need to be brought with it.

Thanks again.
 
C

Charles Calvert

In the AfterUpdate event of the combo box:

Me.txtAddress = DLookUp("[Address]","[myTable]","[Name]='" & Me.cboName &
"'")

Be sure to use your own control, table, and field names. In your report,
you'll need to do something similar, since unbound controls won't carry over
to a report.

Carl Rapson

Yes that will work, but is there a way to retain that information to then
run a report off the table that drives that form?

What I am doing is creating an "Issue-History" table from that form at the
"On Close", then pulling the History table into the printed report. The
problem I am having is that when a name is picked the location and phone
number need to be brought with it.

When the data entry is done via the form, are you saving the address
and phone number to the bound table?
 
J

John W. Vinson

In the AfterUpdate event of the combo box:

Me.txtAddress = DLookUp("[Address]","[myTable]","[Name]='" & Me.cboName &
"'")

Be sure to use your own control, table, and field names. In your report,
you'll need to do something similar, since unbound controls won't carry over
to a report.

Carl Rapson

Yes that will work, but is there a way to retain that information to then
run a report off the table that drives that form?

What I am doing is creating an "Issue-History" table from that form at the
"On Close", then pulling the History table into the printed report. The
problem I am having is that when a name is picked the location and phone
number need to be brought with it.

Thanks again.

If you're assuming that you must create a new table in order to generate a
report, that assumption is *wrong*! The Report should be based on a Query
linking together your issues table, name table, address table, etc.; it can
use a value from your launching form as a criterion to limit the report to the
desired records.

John W. Vinson [MVP]
 
Top