
January 23rd, 2007, 02:41 PM
|
|
Registered User
|
|
Join Date: Jan 2007
Posts: 1
Time spent in forums: 46 m 20 sec
Reputation Power: 0
|
|
|
Textbox to show value of specific record in a different table
Improving a current AccessDB, have minor skill/knowledge with VB code.
Have created button called "Import Itinerary" and a text box beside it called "AIRPORT".
This button should fill the text box with data from record#5 of field ICAO of table SCHEDULE.
I started with the code below, because using "=" worked elsewhere in the form, not because I know if this is the best or most efficient method.
However, I am unsure of:
1. my use of brackets (do I need brackets and !)
2. how to refer to a specifc record of a specific field, i.e.:record #5
3. am I even going in the right direction here
Code:
Private Sub Import_Itinerary_Click()
'get the value in record#5 from the ICAO field in the SCHEDULE table
'put this value in AIRPORT field in this record
AIRPORT.Value = [Tables]![SCHEDULE]!record(5)[ICAO].Value
End Sub
|