fill in unbound field with combobox

G

Guest

I have a problem filling in some unbound fields on my form. Users have to
pick an item form a combobox and then the data must appear in the unbound
fields automaticly.
The data in the combobox comes from a query and the table behind that comes
from an Oracle-db (linked). The column in this table wich is visible in the
combobox (OBJECTNR) contains numeric and alphanumeric data. Changeing this is
no opportunity.
The problem is, with the code I have right now (see below) the unbound field
show data when an alphanumeric item is picked in the combobox. When I pick a
numeric item nothing shows up.
Who can help me out?


Tables
• SI_V_OPERATIONS_OBJ_GEBR (ODBC-link with Oracle-DB)
o OBJECTNR (text-field)
o ROTNR (text-field)
o IDNR (text-field, decimal)
o GEM (text-field)
o GEMDEEL (text-field)
o TIEPE (text-field)
o OMSCHR (text-field)
o STRAAT (text-field)
o HALTE (text-field)
o LOKATIE3 (text-field)
o STX (text-field)
o EIGCODE (text-field)
o RAL (textfield)
o MEDIUM (text-field)
o CONTRNR (text-field, decimal)
o CONTRACTANT (text-field)
o ST (text-field)
o BDAT (date-field)
o BPER (text-field, decimal)
o EDAT date-field)
o EPER (text-field, decimal)
o OPM (text-field)
• tblMutaties
o Id
o Objectnr (text-field)
o Datum (date-field)
o Mutatiesoort (text-field)
o Opmerkingen (text-field)
• tblMutatieSoort
o Id
o MutatieSoort (text-field)
• tblStoringen
o Id
o Objectnr (text-field)
o InvoerDatum (date-field)
o DatumGereed (date-field)
o Brandt (yes/no)

Queries
• qryObjecten
o SELECT SI_V_OPERATIONS_OBJ_GEBR.OBJECTNR, SI_V_OPERATIONS_OBJ_GEBR.ROTNR,
SI_V_OPERATIONS_OBJ_GEBR.IDNR, SI_V_OPERATIONS_OBJ_GEBR.GEM,
SI_V_OPERATIONS_OBJ_GEBR.GEMDEEL, SI_V_OPERATIONS_OBJ_GEBR.TIEPE,
SI_V_OPERATIONS_OBJ_GEBR.OMSCHR, SI_V_OPERATIONS_OBJ_GEBR.STRAAT,
SI_V_OPERATIONS_OBJ_GEBR.HALTE, SI_V_OPERATIONS_OBJ_GEBR.LOKATIE3,
SI_V_OPERATIONS_OBJ_GEBR.STX, SI_V_OPERATIONS_OBJ_GEBR.EIGCODE,
SI_V_OPERATIONS_OBJ_GEBR.RAL, SI_V_OPERATIONS_OBJ_GEBR.MEDIUM,
SI_V_OPERATIONS_OBJ_GEBR.CONTRNR, SI_V_OPERATIONS_OBJ_GEBR.CONTRACTANT,
SI_V_OPERATIONS_OBJ_GEBR.ST, SI_V_OPERATIONS_OBJ_GEBR.BDAT,
SI_V_OPERATIONS_OBJ_GEBR.BPER, SI_V_OPERATIONS_OBJ_GEBR.EDAT,
SI_V_OPERATIONS_OBJ_GEBR.EPER, SI_V_OPERATIONS_OBJ_GEBR.OPM FROM
SI_V_OPERATIONS_OBJ_GEBR WHERE (((SI_V_OPERATIONS_OBJ_GEBR.STX)="G") AND
((SI_V_OPERATIONS_OBJ_GEBR.ST)="G"));
• qryStoringen
o SELECT tblStoringen.Id, tblStoringen.Objectnr, tblStoringen.Brandt,
tblStoringen.[Wordt niet opgelost], tblStoringen.ValseMelding,
tblStoringen.[Invoer datum], tblStoringen.[Datum gereed] FROM tblStoringen;

Form
• frmStoringen
o cboObjectnr (RowSource: SELECT qryObjecten.OBJECTNR, qryObjecten.GEM,
qryObjecten.GEMDEEL, qryObjecten.STRAAT, qryObjecten.HALTE,
qryObjecten.OMSCHR FROM qryObjecten ORDER BY [OBJECTNR];
o Gemeente (ControlSource: =cboObjectnr.Column(1)
o Gemeentedeel (ControlSource: =cboObjectnr.Column(2)
o Adres (ControlSource: =cboObjectnr.Column(3)
o Halte (ControlSource: =cboObjectnr.Column(4)
o Type (ControlSource: =cboObjectnr.Column(5)
 
J

Jeff Boyce

Edo

In the combo box's AfterUpdate event, place code something like:

Me.txtYourFirstTextBox = Me.cboYourComboBox.Column(1)
Me.txtYourSecondTextBox = Me.cboYourComboBox.Column(2)
...

NOTE: read up on the .Column() property -- is it zero-based (starts
counting at 0).

--
Regards

Jeff Boyce
Microsoft Office/Access MVP
Microsoft IT Academy Program Mentor

Edo said:
I have a problem filling in some unbound fields on my form. Users have to
pick an item form a combobox and then the data must appear in the unbound
fields automaticly.
The data in the combobox comes from a query and the table behind that comes
from an Oracle-db (linked). The column in this table wich is visible in the
combobox (OBJECTNR) contains numeric and alphanumeric data. Changeing this is
no opportunity.
The problem is, with the code I have right now (see below) the unbound field
show data when an alphanumeric item is picked in the combobox. When I pick a
numeric item nothing shows up.
Who can help me out?


Tables
• SI_V_OPERATIONS_OBJ_GEBR (ODBC-link with Oracle-DB)
o OBJECTNR (text-field)
o ROTNR (text-field)
o IDNR (text-field, decimal)
o GEM (text-field)
o GEMDEEL (text-field)
o TIEPE (text-field)
o OMSCHR (text-field)
o STRAAT (text-field)
o HALTE (text-field)
o LOKATIE3 (text-field)
o STX (text-field)
o EIGCODE (text-field)
o RAL (textfield)
o MEDIUM (text-field)
o CONTRNR (text-field, decimal)
o CONTRACTANT (text-field)
o ST (text-field)
o BDAT (date-field)
o BPER (text-field, decimal)
o EDAT date-field)
o EPER (text-field, decimal)
o OPM (text-field)
• tblMutaties
o Id
o Objectnr (text-field)
o Datum (date-field)
o Mutatiesoort (text-field)
o Opmerkingen (text-field)
• tblMutatieSoort
o Id
o MutatieSoort (text-field)
• tblStoringen
o Id
o Objectnr (text-field)
o InvoerDatum (date-field)
o DatumGereed (date-field)
o Brandt (yes/no)

Queries
• qryObjecten
o SELECT SI_V_OPERATIONS_OBJ_GEBR.OBJECTNR, SI_V_OPERATIONS_OBJ_GEBR.ROTNR,
SI_V_OPERATIONS_OBJ_GEBR.IDNR, SI_V_OPERATIONS_OBJ_GEBR.GEM,
SI_V_OPERATIONS_OBJ_GEBR.GEMDEEL, SI_V_OPERATIONS_OBJ_GEBR.TIEPE,
SI_V_OPERATIONS_OBJ_GEBR.OMSCHR, SI_V_OPERATIONS_OBJ_GEBR.STRAAT,
SI_V_OPERATIONS_OBJ_GEBR.HALTE, SI_V_OPERATIONS_OBJ_GEBR.LOKATIE3,
SI_V_OPERATIONS_OBJ_GEBR.STX, SI_V_OPERATIONS_OBJ_GEBR.EIGCODE,
SI_V_OPERATIONS_OBJ_GEBR.RAL, SI_V_OPERATIONS_OBJ_GEBR.MEDIUM,
SI_V_OPERATIONS_OBJ_GEBR.CONTRNR, SI_V_OPERATIONS_OBJ_GEBR.CONTRACTANT,
SI_V_OPERATIONS_OBJ_GEBR.ST, SI_V_OPERATIONS_OBJ_GEBR.BDAT,
SI_V_OPERATIONS_OBJ_GEBR.BPER, SI_V_OPERATIONS_OBJ_GEBR.EDAT,
SI_V_OPERATIONS_OBJ_GEBR.EPER, SI_V_OPERATIONS_OBJ_GEBR.OPM FROM
SI_V_OPERATIONS_OBJ_GEBR WHERE (((SI_V_OPERATIONS_OBJ_GEBR.STX)="G") AND
((SI_V_OPERATIONS_OBJ_GEBR.ST)="G"));
• qryStoringen
o SELECT tblStoringen.Id, tblStoringen.Objectnr, tblStoringen.Brandt,
tblStoringen.[Wordt niet opgelost], tblStoringen.ValseMelding,
tblStoringen.[Invoer datum], tblStoringen.[Datum gereed] FROM tblStoringen;

Form
• frmStoringen
o cboObjectnr (RowSource: SELECT qryObjecten.OBJECTNR, qryObjecten.GEM,
qryObjecten.GEMDEEL, qryObjecten.STRAAT, qryObjecten.HALTE,
qryObjecten.OMSCHR FROM qryObjecten ORDER BY [OBJECTNR];
o Gemeente (ControlSource: =cboObjectnr.Column(1)
o Gemeentedeel (ControlSource: =cboObjectnr.Column(2)
o Adres (ControlSource: =cboObjectnr.Column(3)
o Halte (ControlSource: =cboObjectnr.Column(4)
o Type (ControlSource: =cboObjectnr.Column(5)
 
Top