473,397 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

How to use data from other field in a found record

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
1 2087
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

32
by: Neil Ginsberg | last post by:
We're using SQL Server 7 with an Access 2000 MDB as a front end with ODBC linked tables. I recently created a new set of tables for the app, and users are complaining that unsaved data is being...
1
by: A.J.M. van Rijthoven | last post by:
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...
9
by: Brad | last post by:
I have written some code to manipulate data/records in a MASTER (order header) and DETAIL (order details) tables. What I have written is too extensive to post but essentially trying to: 1....
2
by: x | last post by:
hi i am a pilot by profession. i want to create a database of my logbook using ms access 2002. i am facing a problem regarding the format of time field. when i select "Data/Time" data type for my...
3
by: jpr | last post by:
Hello, I know that this is not the rule but need some help. My datbase has three tables: MASTER TEMPLATES FORMS I have a form which is based on a table named MASTER. I have a primary key...
3
by: cyber0ne | last post by:
I'm designing a basic form for data entry into one main table. There are two fields in the table that I would like to be automatically populated, not user-entered, when the record is posted. ...
12
by: TS | last post by:
If I was to have my biz layer ask the data layer to load a particular object based on key field info i pass to it, and it cannot create the object becaues it isnt' in the Db, should the data layer...
20
by: hippomedon | last post by:
Hello everyone, I'm looking for some advice on whether I should break the normalization rule. Normally, I would not consider it, but this seems to be a special case. I have created an...
4
by: Neil | last post by:
Is there a problem with stability when one uses too many text (memo) fields? I'm having a problem with data from one record occasionally ending up in another record, though apparently not through...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.