Issues linking fields within a form an a table (1 Viewer)

Mat1994

Registered User.
Local time
Today, 19:42
Joined
Nov 29, 2018
Messages
94
Hi All,

I'm creating an airport database. And I'm having problems linking my form with my table.

I've created a tables with the following fields :
ICAO, IATA, Airport Country, Airport City, Elevation, Airport Usage : Inactive, Airport Usage : Destination Airport.

ICAO, IATA, ICAO, IATA, Airport Country, Airport City are short text.
Elevation is a number.
Airport Usage : Inactive, Airport Usage : Destination Airport are checkboxs.

I've created a form where :
- ICAO, IATA, Airport City are comboboxs that autopoputale each other and the Airport Country (which is not a combobox). Airport Usage : Inactive and - - Airport Usage : Inactive, Airport Usage : Destination Airport are checkboxs that if one is ticked the other one gets unticked.

What I would like to do, is when ICAO, IATA or the airport city is selected, it autopopulate the Elevation and the checkboxs with the information of the table.
I can't seem to link the ICAO, IATA, airport city with the Elevation field and the checkboxs...

I've tried a few things but none work.

I hope I am clear enough. If you want to to attach my database, please let me know.
Thank you for your help.
Mat
 

Mat1994

Registered User.
Local time
Today, 19:42
Joined
Nov 29, 2018
Messages
94
So,
I've added the field in the row source of the combobox.
I've added =[ICAO].[Column](4) in the control souce of the field I want to add. (I'm sure the column is 4, because I started counting from 0)
I've added in the combobox event "AfterUpdate" , Me!Elevation.Text = me!ICAO.Column(4)
It doesn't work. I've tried instead of Me!Elevation.Text = me!ICAO.Column(4) :
Me.Elevation.Text = me.ICAO.Column(4)
Me!Elevation.Value = me!ICAO.Column(4)
Me.Elevation.Value = me.ICAO.Column(4)

none work... and I get the run-time error 2448 that doesn't help.

Mat
 

June7

AWF VIP
Local time
Yesterday, 23:42
Joined
Mar 9, 2014
Messages
5,466
Form is bound to this table? Seems to me what you need to do is go to record for value selected in combobox - a 'search' form. Controls used to input search criteria should be UNBOUND. Review http://allenbrowne.com/ser-62.html

Advise not to use spaces nor punctuation/special characters (underscore only exception) in naming convention.

Suggest the two AirportUsage fields be only 1 field with two value options (Null could be allowed).
 
Last edited:

Gasman

Enthusiastic Amateur
Local time
Today, 08:42
Joined
Sep 21, 2011
Messages
14,232
Have you change the Combo properties for the correct number of fields?

ColumnCount?
 

Mat1994

Registered User.
Local time
Today, 19:42
Joined
Nov 29, 2018
Messages
94
Thank you for your help. I managed to solve my problem with your help.

Mat
 

Gasman

Enthusiastic Amateur
Local time
Today, 08:42
Joined
Sep 21, 2011
Messages
14,232
Well for the benefit of everyone, please advise what you did to fix the problem.

Someone else might likely have the same problem in the future, and it could help.
 

Mat1994

Registered User.
Local time
Today, 19:42
Joined
Nov 29, 2018
Messages
94
I managed to solve the problem by checking that the number of columns in row source was the same as the number in Column Count.

Mat
 

Users who are viewing this thread

Top Bottom