By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,497 Members | 2,127 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,497 IT Pros & Developers. It's quick & easy.

How to use data from other field in a found record

P: n/a
I have a table instrumenten (INSID Instrumentname, CATID), a table
Categorie (CATID, Categorydescription), Netten (NETID, description of
net) and a table (kpltblinstrument) that links the instruments to a
specific net (NETID, INSID, amount).
I have a form which displays the name of the net and it holds a the
subform from table lnknetins. I have two unlinked fields (combobox) on
the form (voorlopigcategorie and voorlopiginstrument). When I select a
category, the following code provides a query for the
voorlopiginstrument combobox.

If voorlopigcategorie.Text = "-" Then
PublicSql = "SELECT
Instrumenten.instrumentnaam,instrumenten.insid, Instrumenten.categorie
FROM Instrumenten;"
Else
PublicSql = "SELECT
instrumenten.Instrumentnaam,instrumenten.insid, instrumenten.Categorie
FROM instrumenten WHERE
(((instrumenten.Categorie)=[Forms]![Inhoud_van_net]![voorlopigcategorie].[value]));"
End If
voorlopiginstrument.RowSource = PublicSql

Now I want to fill the field INSID on my subform with the INSID from
the selected instrument in voorlopiginstrument.
Voorlopiginstrument.value only gives me the name of the instrument and
not the INSID.
How do I do this??

Simplified:
I've looked up a record in a table based on a name and now I want to
use another field of the found record and place its value in another
record. How do I do this??
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
If I understand your needs correctly, one of the simpler ways to do this is
to set the BoundColumn property of your Voorlopiginstrument combobox to 2.
Voorlopiginstrument.value will then return the value from the combobox's 2nd
column (make sure the ColumnCount property is set to at least 2 and the
ColumnWidths give widths for at least 2 columns), which should be the ID,
while the box will continue to display the value from the first column.

HTH
- Turtle

"A.J.M. van Rijthoven" <to***@xs4all.nl> wrote in message
news:pf********************************@4ax.com...
I have a table instrumenten (INSID Instrumentname, CATID), a table
Categorie (CATID, Categorydescription), Netten (NETID, description of
net) and a table (kpltblinstrument) that links the instruments to a
specific net (NETID, INSID, amount).
I have a form which displays the name of the net and it holds a the
subform from table lnknetins. I have two unlinked fields (combobox) on
the form (voorlopigcategorie and voorlopiginstrument). When I select a
category, the following code provides a query for the
voorlopiginstrument combobox.

If voorlopigcategorie.Text = "-" Then
PublicSql = "SELECT
Instrumenten.instrumentnaam,instrumenten.insid, Instrumenten.categorie
FROM Instrumenten;"
Else
PublicSql = "SELECT
instrumenten.Instrumentnaam,instrumenten.insid, instrumenten.Categorie
FROM instrumenten WHERE
(((instrumenten.Categorie)=[Forms]![Inhoud_van_net]![voorlopigcategorie].[va
lue]));" End If
voorlopiginstrument.RowSource = PublicSql

Now I want to fill the field INSID on my subform with the INSID from
the selected instrument in voorlopiginstrument.
Voorlopiginstrument.value only gives me the name of the instrument and
not the INSID.
How do I do this??

Simplified:
I've looked up a record in a table based on a name and now I want to
use another field of the found record and place its value in another
record. How do I do this??

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.